diff --git a/wichteln.py b/wichteln.py index 7f69277..c742ff7 100644 --- a/wichteln.py +++ b/wichteln.py @@ -38,6 +38,9 @@ class Wichtelee(object): def isReceiver(self): return self.giverName + def isGiver(self): + return self.receiverName + def inform(self): infoLine = "{0} -> {1}".format(self.name, self.receiverName) global notarMsg @@ -80,7 +83,14 @@ wichtelees = [ ] + for first in wichtelees: + if DEBUG: + print("Handling {}".format(first.name)) + if first.isGiver(): + if DEBUG: + print("Is already giver, skip over") + continue checked = [] while True: n = random.randint(0, len(wichtelees)-1)