some additional checks

This commit is contained in:
2019-11-23 19:00:05 +01:00
parent b7ded23dee
commit 1c1d10e186

View File

@ -38,6 +38,9 @@ class Wichtelee(object):
def isReceiver(self): def isReceiver(self):
return self.giverName return self.giverName
def isGiver(self):
return self.receiverName
def inform(self): def inform(self):
infoLine = "{0} -> {1}".format(self.name, self.receiverName) infoLine = "{0} -> {1}".format(self.name, self.receiverName)
global notarMsg global notarMsg
@ -80,7 +83,14 @@ wichtelees = [
] ]
for first in 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 = [] checked = []
while True: while True:
n = random.randint(0, len(wichtelees)-1) n = random.randint(0, len(wichtelees)-1)