MCPcopy Create free account
hub / github.com/geekcomputers/Python / player_input

Function player_input

BoardGame-CLI/snakeLadder.py:12–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11# players input function
12def player_input():
13 global players
14 global current_loc
15 global isReady
16
17 x = True
18 while x:
19 player_num = int(input("Enter the number of players: "))
20 if player_num > 0:
21 for i in range(player_num):
22 name = input(f"Enter player {i + 1} name: ")
23 players[name] = current_loc
24 isReady[name] = False
25 x = False
26 play() # play function call
27
28 else:
29 print("Number of player cannot be zero")
30 print()
31
32
33# Dice roll method

Callers 2

playFunction · 0.85
snakeLadder.pyFile · 0.85

Calls 1

playFunction · 0.70

Tested by

no test coverage detected