Skip to content
Snippets Groups Projects
Commit 3db3cfef authored by Jakob Kirsch's avatar Jakob Kirsch
Browse files

auto generated by makefile

parent 60398df7
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ import random, time, atexit
#definitions
DEBUG = False
DEBUG = True
CHEAT = False
COLOR_CODES = {"NEUTRAL" : "\033[1;37;40m", "BLUE" : "\033[1;34;40m", "GREEN" : "\033[1;32;40m", "RED" : "\033[1;31;40m", "YELLOW" : "\033[1;33;40m"}
......@@ -40,6 +40,8 @@ def compare_cards(card1, card2):
return ret
if card1[0] == card2[0]: ret = True
elif card1[1] == card2[1]: ret = True
elif card2[1] == "NEUTRAL": ret = True
elif card1[1] == "NEUTRAL": ret = True
else: ret = False
if ret:
if card2[0] == "+2":
......@@ -61,6 +63,7 @@ for color in COLORS:
CARDS.append(("+2", color))
CARDS.append(["C", "NEUTRAL"])
CARDS.append(["+4", "NEUTRAL"])
CARDS.append(["R", "NEUTRAL"])
#players
p = input("Player: ")
while p != "":
......@@ -68,7 +71,7 @@ while p != "":
p = input("Player: ")
#get cards
random.shuffle(CARDS)
random.shuffle(PLAYERS)
#random.shuffle(PLAYERS)
PCARDS = {}
......@@ -82,7 +85,8 @@ clear()
STACK = [CARDS.pop()]
#main
while len(PLAYERS) > 1:
for player in PLAYERS:
for playerc in range(0, len(PLAYERS)):
player = PLAYERS[playerc]
print_stack()
input("\033[1;30;40m" + player + " ist dran. Gib das Handy weiter und drücke Enter")
print("0) Eine Karte ziehen")
......@@ -113,4 +117,9 @@ while len(PLAYERS) > 1:
if len(PCARDS[player]) == 0:
del(PCARDS[player])
print("\033[1;30;40m" + player + " hat gewonnen!")
if STACK[::-1][0][0] == "R":
PLAYERS = PLAYERS[::-1]
for n in range(0, len(PLAYERS)):
PLAYERS.append(PLAYERS.pop())
break
time.sleep(1)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment