-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
71 lines (51 loc) · 1.22 KB
/
main.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
'''
Sequence Online
main.py - main script to run and game loop
Author: Pratiksha Jain
'''
#-------------#
# Imports
from game import Game
#-------------#
# Initializing Game
p1 = input("Enter player 1 name: ")
p2 = input("Enter player 2 name: ")
game = Game(1, players=[p1, p2])
game.startGame()
print (game.players[0].showHand())
print (game.players[1].showHand())
game.board.showBoard()
run = True
move = ''
#-------------#
# Game Loop
while run:
player = game.turn
game.move = input("It is player %s turn: "%(game.players[player].name))
card_id, pos = game.getMove()
status = game.play(player, card_id, pos)
if status == -1: # winner
run = False
elif status == 0: # valid turn
game.players[player].showHand()
game.updateTurn()
game.board.showBoard()
elif status == 1:
print("try again")
pass
elif status == 2:
print("try again")
pass
elif status == 3:
print("try again")
pass
elif status == 4:
print("try again")
pass
elif status == 5:
print("try again")
pass
elif status == 6:
print("try again")
pass
#-------------#