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