DEBUGGing your Partner!!!

Gentleman-

Well-Known Member
My code-
class Heart:
def __init__(self):
self.is_open = True
self.capacity = float('inf')

class Partner:
def __init__(self, name, values):
self.name = name
self.values = values # List of core beliefs
self.memory = [] # To store shared experiences
self.is_compiled = False

def compile_connection(self, your_values):
"""
The 'Compilation' process: Checking for shared
dependencies and core compatibility.
"""
print(f"Compiling connection with {self.name}...")

Check for shared values (intersection of sets)
shared_dependencies = set(self.values) & set(your_values)

if len(shared_dependencies) > 0:
self.is_compiled = True
print("Successfully compiled! High compatibility found.")
return True
else:
raise Exception("Compilation Error: Incompatible core values.")

def run_relationship_loop(partner):
"""
The main runtime: Love is a continuous loop.
"""
while partner.is_compiled:
try:
moment = "Shared a cup of coffee"
partner.memory.append(moment)
print(f"Status: {moment}. System stable.")

Exit condition (optional, but real love stays in the loop)
break
except Exception as e:
Error handling: The 'Forfeit' or 'Forgive' logic
print(f"Handling conflict: {e}")
continue

--- Execution ---

my_values = ["Trust", "Humor", "Adventure"]
potential_partner = Partner("Alex", ["Trust", "Kindness", "Adventure"])

try:
if potential_partner.compile_connection(my_values):
run_relationship_loop(potential_partner)
except Exception as err:
print(f"Build Failed: {err}")
 

Gorgeous_Aura

Well-Known Member
My code-
class Heart:
def __init__(self):
self.is_open = True
self.capacity = float('inf')

class Partner:
def __init__(self, name, values):
self.name = name
self.values = values # List of core beliefs
self.memory = [] # To store shared experiences
self.is_compiled = False

def compile_connection(self, your_values):
"""
The 'Compilation' process: Checking for shared
dependencies and core compatibility.
"""
print(f"Compiling connection with {self.name}...")

Check for shared values (intersection of sets)
shared_dependencies = set(self.values) & set(your_values)

if len(shared_dependencies) > 0:
self.is_compiled = True
print("Successfully compiled! High compatibility found.")
return True
else:
raise Exception("Compilation Error: Incompatible core values.")

def run_relationship_loop(partner):
"""
The main runtime: Love is a continuous loop.
"""
while partner.is_compiled:
try:
moment = "Shared a cup of coffee"
partner.memory.append(moment)
print(f"Status: {moment}. System stable.")

Exit condition (optional, but real love stays in the loop)
break
except Exception as e:
Error handling: The 'Forfeit' or 'Forgive' logic
print(f"Handling conflict: {e}")
continue

--- Execution ---

my_values = ["Trust", "Humor", "Adventure"]
potential_partner = Partner("Alex", ["Trust", "Kindness", "Adventure"])

try:
if potential_partner.compile_connection(my_values):
run_relationship_loop(potential_partner)
except Exception as err:
print(f"Build Failed: {err}")
And u got exception handler too. Woaah. Who is alex?
 

Missmeadow

Active Member
class Partner:
def __init__(self, name):
self.name = name
self.communication = False
self.trust = False
self.understanding = False
self.patience = False
self.pamper = False
self.love = False
self.foodie = False
self.admire = False
self.acceptance = False
self.hugs = False
self.kisses = False

def add(self, quality):
if hasattr(self, quality):
setattr(self, quality, True)
print(f"{quality.capitalize()} added")
else:
print(f"{quality} is not valid")

def is_compatible(self):
return (
self.communication and
self.trust and
self.understanding and
self.patience and
self.pamper and
self.love and
(self.foodie or self.admire) and
self.acceptance and
self.hugs and
self.kisses
)


def compile_partner(partner):
print("\nCompiling...\n")

if partner.is_compatible():
print("Compilation Successful!")
print("Perfect Partner Found!")
print("Foodie mode ON ")
print("Unlimited hugs and kisses ")
print("Loves me exactly the way I am ")
else:
print("Compilation Failed!")
print("Missing some important qualities.")


# Example usage
p = Partner("My Future Love")

features = [
"communication", "trust", "understanding", "patience",
"pamper", "love", "foodie", "admire",
"acceptance", "hugs", "kisses"
]

for f in features:
p.add(f)

compile_partner(p)
 
Last edited:

Gorgeous_Aura

Well-Known Member
Com
class Partner:
def __init__(self, name):
self.name = name
self.communication = False
self.trust = False
self.understanding = False
self.patience = False
self.pamper = False
self.love = False
self.foodie = False
self.admire = False
self.acceptance = False
self.hugs = False
self.kisses = False

def add(self, quality):
if hasattr(self, quality):
setattr(self, quality, True)
print(f"{quality.capitalize()} added")
else:
print(f"{quality} is not valid")

def is_compatible(self):
return (
self.communication and
self.trust and
self.understanding and
self.patience and
self.pamper and
self.love and
(self.foodie or self.admire) and
self.acceptance and
self.hugs and
self.kisses
)


def compile_partner(partner):
print("\nCompiling...\n")

if partner.is_compatible():
print("Compilation Successful!")
print("Perfect Partner Found!")
print("Foodie mode ON ")
print("Unlimited hugs and kisses ")
print("Loves you exactly the way you are ")
else:
print("Compilation Failed!")
print("Missing some important qualities.")


# Example usage
p = Partner("My Future Love")

features = [
"communication", "trust", "understanding", "patience",
"pamper", "love", "foodie", "admire",
"acceptance", "hugs", "kisses"
]

for f in features:
p.add(f)

compile_partner(p)
compile this code for me. I want to know the output
 

Missmeadow

Active Member
Com

compile this code for me. I want to know the output
Communication added

Trust added

Understanding added

Patience added

Pamper added

Love added

Foodie added

Admire added

Acceptance added

Hugs added

Kisses added


Compiling...

Compilation Successful!

Perfect Partner Found!

Foodie mode ON

Unlimited hugs and kisses

Loves me exactly the way I am

Run completed in 3033.5ms
 

Gorgeous_Aura

Well-Known Member
Communication added

Trust added

Understanding added

Patience added

Pamper added

Love added

Foodie added

Admire added

Acceptance added

Hugs added

Kisses added


Compiling...

Compilation Successful!

Perfect Partner Found!

Foodie mode ON

Unlimited hugs and kisses

Loves me exactly the way I am

Run completed in 3033.5ms
No testing needed huh? Love u Kanmani
 
Back
Top