Skip to content

Commit ee4ac23

Browse files
authored
final commit
full game
1 parent 01ab61b commit ee4ac23

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

stripMe.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
from Assets.util import *
2+
3+
def strip_me():
4+
players = prepPlayers()
5+
discardPlie = makeStack()
6+
7+
def play(currentPlayer):
8+
counter = 0
9+
if currentPlayer == 0:
10+
hand = players[0]
11+
elif currentPlayer == 1:
12+
hand = players[1]
13+
14+
played = playCard(currentPlayer, hand, discardPlie)
15+
print('\n'+str(played[0]))
16+
17+
try:
18+
#IF card played is a "Pretty"
19+
if isPayCard(top(discardPlie)):
20+
#pay = number of cards to pay with
21+
pay = getCardRate(top(discardPlie))
22+
23+
#Pay with 'pay' number of cards
24+
for _ in range(pay):
25+
if currentPlayer == 1:
26+
play(0)
27+
elif currentPlayer == 0:
28+
play(1)
29+
30+
#if card played is a pretty
31+
if isPayCard(top(discardPlie)):
32+
#stop paying
33+
break
34+
else:
35+
#make a note of how much cards already paid
36+
counter += 1
37+
38+
#if number of cards paid matches the amount to be paid
39+
if counter == pay:
40+
#player0 takes all the cards in the discardPile
41+
takePayment(hand, discardPlie)
42+
print("\n"+"The full payment was made. Player {} claimed the discard pile".format(currentPlayer))
43+
except:
44+
pass
45+
46+
print(showGreeting)
47+
while True:
48+
option = input("play(Enter); quit(q,then enter) ")
49+
50+
if option is 'q':
51+
print("You quit the game before it ended, so there's no result. Bye!")
52+
break
53+
54+
try:
55+
play(1)
56+
except:
57+
print("Player 0 WON!")
58+
break
59+
60+
try:
61+
play(0)
62+
except:
63+
print("Player 1 WON!")
64+
break
65+
66+
print('\n')
67+
68+
if __name__ == '__main__':
69+
strip_me()

0 commit comments

Comments
 (0)