-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepl.py
More file actions
53 lines (45 loc) · 1.48 KB
/
Copy pathrepl.py
File metadata and controls
53 lines (45 loc) · 1.48 KB
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
from game import Game
if __name__ == "__main__":
print("Hello and welcome to Connect3D!")
# Create game
game = Game()
while not game.game_ended:
# Determine whose move it is
turn_num = game.turn
player_id = (turn_num-1) % game.num_players
player = game.player_dict[player_id]
# Prompt player for move and interpret
print("Turn ", game.turn, ", ", player.name, "'s move:")
move = game.interpret_move(str(input()))
# Execute move
game.execute_move(move)
# Update state as needed to end turn
Game.end_turn(game)
'''
______________________________
/ / / / / /
/_____/_____/_____/_____/_____/
/ / / / / /
/_____/_____/_____/_____/_____/
/ / / / / /
/_____/_____/_____/_____/_____/
/ / / / / /
/_____/_____/_____/_____/_____/
/| /| /| /| /| /
/_|___/_|___/_|___/_|___/_|___/
| |___|_|___|_|___|_|___|_|___|
| / | / | / | / | / |
|/____|/____|/____|/____|/____|
| | | | | |
| | | | | |
|_____|_____|_____|_____|_____|
| | | | | |
| | | | | |
|_____|_____|_____|_____|_____|
| | | | | |
| | | | | |
|_____|_____|_____|_____|_____|
| | | | | |
| | | | | 0 |
|_____|_____|_____|_____|_____|
'''