File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 5
5
ZOOMBINIS_PER_TEAM = 8
6
6
7
7
# Functions
8
+
9
+
8
10
def setup_teams ():
9
11
teams = []
10
12
for i in range (2 ):
@@ -14,36 +16,39 @@ def setup_teams():
14
16
teams .append (team )
15
17
return teams
16
18
19
+
17
20
def display_teams (teams ):
18
21
for i , team in enumerate (teams , start = 1 ):
19
22
print (f"Team { i } : { team } " )
20
23
24
+
21
25
def main ():
22
26
print ("Welcome to Zoombinis!" )
23
27
teams = setup_teams ()
24
-
28
+
25
29
while True :
26
30
display_teams (teams )
27
31
team_choice = int (input ("Select a team (1 or 2): " ))
28
-
32
+
29
33
if team_choice < 1 or team_choice > 2 :
30
34
print ("Invalid team choice. Please select 1 or 2." )
31
35
continue
32
-
36
+
33
37
selected_team = teams [team_choice - 1 ]
34
38
zoombini_choice = int (input ("Select a Zoombini (1-8): " ))
35
-
39
+
36
40
if zoombini_choice < 1 or zoombini_choice > 8 :
37
41
print ("Invalid Zoombini choice. Please select a number between 1 and 8." )
38
42
continue
39
-
43
+
40
44
zoombini = selected_team [zoombini_choice - 1 ]
41
45
print (f"Selected Zoombini: { zoombini } " )
42
-
46
+
43
47
play_again = input ("Do you want to play again? (y/n): " )
44
48
if play_again .lower () != "y" :
45
49
print ("Thanks for playing Zoombinis!" )
46
50
break
47
51
52
+
48
53
if __name__ == "__main__" :
49
54
main ()
You can’t perform that action at this time.
0 commit comments