10000 Refactoring the beetle game · SamenaBasith/intro-to-python@6177f51 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6177f51

Browse files
committed
Refactoring the beetle game
1 parent e2df459 commit 6177f51

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

session_06/answers/B3.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@
3535
print("LETS START!!!!!")
3636
winner = None
3737

38-
while not winner:
38+
while winner == None:
3939
for current_player in range(players):
4040

4141
x = input("Player " + str(current_player) + ": Roll the dice...")
42-
if x == "q":
43-
break
4442
dice_roll = str(random.randint(1, 6))
4543
scores[current_player] += 1
4644
print("You rolled a: " + dice_roll)
@@ -64,6 +62,6 @@
6462
if sum(beetles[current_player].values()) == 0:
6563
winner = current_player
6664

67-
print("The winner is: " + str(winner))
65+
print("The winner is player: " + str(winner))
6866

6967
print(scores)

0 commit comments

Comments
 (0)
0