I tried to make a UNO hand out system but it seems to not work: when I type "S", it just terminates. (It's not very finished yet)
Here is my code so far:
import random n = 0 command = input("Rules[R], Start[S], End[E] or Quit[Q]") if command.upper == "S": while n < 7: pick_type = random.randint[1, 9] pick_colour = random.randint[1, 5] if pick_type == 5 or 6 or 7: pick_colour = random.randint[1, 4] if pick_colour == 1: colour = "Blue" elif pick_colour == 2: colour = "Green" elif pick_colour == 3: colour = "Red" else: colour = "Yellow" print(colour) elif pick_type == 1 or 2 or 3 or 4: pick_number = random.randint[1, 10] number = str(pick_number) print(number) else: draw_condition = random.randint[1, 2] if draw_condition == 1: card_type = "Wild" else: card_type = "Wild Draw 4" print(card_type) n += 1
And the result I get is:
Rules[R], Start[S], End[E], Quit[Q] $ S Process terminated with exit code 0.
https://stackoverflow.com/questions/66856789/is-there-a-way-to-make-an-uno-card-shuffler-and-hand-out March 29, 2021 at 11:14PM
没有评论:
发表评论