some additional checks
This commit is contained in:
10
wichteln.py
10
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)
|
||||
|
Reference in New Issue
Block a user