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

auto generated by makefile

parent 3db3cfef
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,8 @@ OVERFLOW = 0 #for +2 ...@@ -17,6 +17,8 @@ OVERFLOW = 0 #for +2
WANTED_COLOR = "NEUTRAL" #for C WANTED_COLOR = "NEUTRAL" #for C
JMP = False
def clear(): def clear():
print("\033[1;30;40m" + "\n" * 100) print("\033[1;30;40m" + "\n" * 100)
def render_card(lis): def render_card(lis):
...@@ -33,6 +35,9 @@ def compare_cards(card1, card2): ...@@ -33,6 +35,9 @@ def compare_cards(card1, card2):
c = input("Color: ") c = input("Color: ")
WANTED_COLOR = c WANTED_COLOR = c
card2[1] = c card2[1] = c
if card2[0] == "+4":
OVERFLOW += 4
return True
elif WANTED_COLOR != "NEUTRAL": elif WANTED_COLOR != "NEUTRAL":
ret = card2[1] == WANTED_COLOR ret = card2[1] == WANTED_COLOR
if ret: if ret:
...@@ -46,10 +51,6 @@ def compare_cards(card1, card2): ...@@ -46,10 +51,6 @@ def compare_cards(card1, card2):
if ret: if ret:
if card2[0] == "+2": if card2[0] == "+2":
OVERFLOW += 2 OVERFLOW += 2
ret = True
elif card2[0] == "+4":
OVERFLOW += 4
ret = True
return ret return ret
if not DEBUG: if not DEBUG:
atexit.register(clear) atexit.register(clear)
...@@ -64,6 +65,8 @@ for color in COLORS: ...@@ -64,6 +65,8 @@ for color in COLORS:
CARDS.append(["C", "NEUTRAL"]) CARDS.append(["C", "NEUTRAL"])
CARDS.append(["+4", "NEUTRAL"]) CARDS.append(["+4", "NEUTRAL"])
CARDS.append(["R", "NEUTRAL"]) CARDS.append(["R", "NEUTRAL"])
for n in range(0, 2):
CARDS.append(("X", color))
#players #players
p = input("Player: ") p = input("Player: ")
while p != "": while p != "":
...@@ -86,6 +89,9 @@ STACK = [CARDS.pop()] ...@@ -86,6 +89,9 @@ STACK = [CARDS.pop()]
#main #main
while len(PLAYERS) > 1: while len(PLAYERS) > 1:
for playerc in range(0, len(PLAYERS)): for playerc in range(0, len(PLAYERS)):
if JMP:
JMP = False
continue
player = PLAYERS[playerc] player = PLAYERS[playerc]
print_stack() print_stack()
input("\033[1;30;40m" + player + " ist dran. Gib das Handy weiter und drücke Enter") input("\033[1;30;40m" + player + " ist dran. Gib das Handy weiter und drücke Enter")
...@@ -103,7 +109,7 @@ while len(PLAYERS) > 1: ...@@ -103,7 +109,7 @@ while len(PLAYERS) > 1:
if not compare_cards(STACK[::-1][0], PCARDS[player][card - 1]): if not compare_cards(STACK[::-1][0], PCARDS[player][card - 1]):
card = -1 card = -1
card -= 1 #python starts at 0 card -= 1 #python starts at 0
if PCARDS[player][card][0] in ["+2", "+4"] and OVERFLOW > 0: if not PCARDS[player][card][0] in ["+2", "+4"] and OVERFLOW > 0:
print("\033[1;30;40m" + player + " muss " + str(OVERFLOW) + " Karten ziehen!") print("\033[1;30;40m" + player + " muss " + str(OVERFLOW) + " Karten ziehen!")
for n in range(0, OVERFLOW): for n in range(0, OVERFLOW):
PCARDS[player].append(CARDS.pop()) PCARDS[player].append(CARDS.pop())
...@@ -122,4 +128,6 @@ while len(PLAYERS) > 1: ...@@ -122,4 +128,6 @@ while len(PLAYERS) > 1:
for n in range(0, len(PLAYERS)): for n in range(0, len(PLAYERS)):
PLAYERS.append(PLAYERS.pop()) PLAYERS.append(PLAYERS.pop())
break break
if STACK[::-1][0] == "X":
JMP = True
time.sleep(1) 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