-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
80 lines (70 loc) · 2.69 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# players and their rolls, checked here with beetle
#one instance of Beetle for each of four players and ask the user for player names
import dice
class Beetle:
#defining all parts of beetle and player name
def __init__(self, name):
self.name = name
self.body = False
self.head = False
self.right_wing = False
self.left_wing = False
self.right_legs = False
self.left_legs = False
self.right_antenna = False
self.left_antenna = False
self.right_eye = False
self.left_eye = False
# reads rolls and if correct is rolled part of beetle is added to person
def turn(self, roll):
if not self.body and roll == 1:
print("body is built.")
self.body = True
return True
if not self.head and roll == 2:
print("head is built.".format(self.name))
self.head = True
return True
if not self.right_legs and roll == 3:
print("right legs are built.".format(self.name))
self.right_legs = True
return True
if not self.left_legs and roll == 3:
print("left legs are built.".format(self.name))
self.left_legs = True
return True
if not self.right_wing and roll == 4:
print("right wing is built.".format(self.name))
self.right_wing = True
return True
if not self.left_wing and roll == 4:
print("left wing is built.".format(self.name))
self.left_wing = True
return True
if not self.right_antenna and roll == 5:
print("right antenna is built.".format(self.name))
self.right_antenna = True
return True
if not self.left_antenna and roll == 5:
print("left antenna is built.".format(self.name))
self.left_antenna = True
return True
if not self.right_eye and roll == 6:
print("right eye is built.".format(self.name))
self.right_eye = True
return True
if not self.left_eye and roll == 6:
print("left eye is built.".format(self.name))
self.left_eye = True
return True
return False
# prints parts of beetle that person has
def print(self):
print(self)
def complete(self):
if True:
return (self.body and self.head and self.right_wing and self.left_wing and self.right_legs and self.left_legs and self.right_antenna and self.left_antenna and self.right_eye and self.left_eye)
class Dice_roll:
def turn(self, roll_dice):
out = Beetle.turn(self, roll_dice)
return out