Guest User

Dice poker test

a guest
Jan 23rd, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.03 KB | None | 0 0
  1. from random import randint as ri
  2.  
  3.  
  4. def dice_poker():
  5.     dice1 = ri(1, 6)
  6.     dice2 = ri(1, 6)
  7.     dice3 = ri(1, 6)
  8.     dice4 = ri(1, 6)
  9.     dice5 = ri(1, 6)
  10.     pair = dice1 == dice2 or dice1 == dice3 or dice1 == dice4 or dice1 == dice5 or dice2 == dice1 or dice2 == dice3 \
  11.            or dice2 == dice4 or  dice2 == dice5 or dice3 == dice1 or dice3 == dice2 or dice3 == dice4 or dice3 == dice5\
  12.            or dice4 == dice1 or  dice4 == dice2 or dice4 == dice3 or dice4 ==  dice5 or dice5 ==  dice1 or  dice5 == dice2\
  13.            or dice5 == dice3 or dice5 == dice4
  14.     print("Wylosowana wartość kości: " +str(dice1))
  15.     print("Wylosowana wartość kości: " +str(dice2))
  16.     print("Wylosowana wartość kości: " +str(dice3))
  17.     print("Wylosowana wartość kości: " +str(dice4))
  18.     print("Wylosowana wartość kości: " +str(dice5))
  19.     if dice1 == dice2 == dice3 == dice4 == dice5:
  20.         print("Poker!!!")
  21.     elif dice1 == 1 and dice1<dice2<dice3<dice4<dice5:
  22.         print("Small street!")
  23.     elif dice1 == 2 and dice1<dice2<dice3<dice4<dice5:
  24.         print("Big street!")
  25.     elif dice1 == dice2 == dice3 == dice4 or dice2 == dice3 == dice4 == dice5 or dice3 == dice4 == dice5 == dice1:
  26.         print("Kareta!")
  27.  
  28.     elif pair:
  29.         count_pair = 0
  30.         count_pair = count_pair + 1
  31.         if count_pair == 1:
  32.             print("You've got pair")
  33.         if count_pair > 1:
  34.             print("You've got "+str(count_pair)+" pairs.")
  35. dice_poker()
  36. # Znaczenie układów kości
  37.     # Nic – pięć nie tworzących żadnego układu oczek.
  38.     # Para – dwie kości o tej samej liczbie oczek.
  39.     # Dwie Pary – dwie pary kości, o tej samej liczbie oczek.
  40.     # Trójka – trzy kości o tej samej liczbie oczek.
  41.     # Mały Strit – kości pokazujące wartości od 1 do 5, po kolei.
  42.     # Duży Strit – kości pokazujące wartości od 2 do 6, po kolei.
  43.     # Full – jedna para i trójka.
  44.     # Kareta – cztery kości o tej samej liczbie oczek.
  45.     # Poker – pięć kości o tej samej liczbie oczek.
  46.  
  47.  
Add Comment
Please, Sign In to add comment