From fe8865a9470a47c10aa6d1d8f8aacd63357d3fe9 Mon Sep 17 00:00:00 2001 From: Hillary Nyakundi <63947040+larymak@users.noreply.github.com> Date: Thu, 15 Sep 2022 23:20:11 +0300 Subject: [PATCH] Revert "Added Inventory Management System" --- OTHERS/InvenTree | 1 - "dice_game_\"barbut\"" | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) delete mode 160000 OTHERS/InvenTree create mode 100644 "dice_game_\"barbut\"" diff --git a/OTHERS/InvenTree b/OTHERS/InvenTree deleted file mode 160000 index 52023de2..00000000 --- a/OTHERS/InvenTree +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 52023de2447b30092d89ba36e04c9e5a788f5c05 diff --git "a/dice_game_\"barbut\"" "b/dice_game_\"barbut\"" new file mode 100644 index 00000000..9845b098 --- /dev/null +++ "b/dice_game_\"barbut\"" @@ -0,0 +1,34 @@ +"""Barbut""" +from random import randint + + +def barbut(): + while True: + score_pairs = [17, 16, 15, 14, 13, 12] # values for pair-outcomes + user = [randint(1,6), randint(1, 6)] + bot = [randint(1, 6), randint(1, 6)] + scor_user = 0 + scor_bot = 0 + + print(f"Your dice: {user[0]}, {user[1]} | Bot's dice: {bot[0]}, {bot[1]}. ") + + if user[0] == user[1]: + scor_user = score_pairs[user[0] - 1] + else: + scor_user = user[0] + user[1] + if bot[0] == bot[1]: + scor_bot = score_pairs[bot[0] - 1] + else: + scor_bot = bot[0] + bot[1] + + if scor_user > scor_bot: + print("+5$") + break + elif scor_user == scor_bot: + print("Play on") + continue # If result is draw, play again + else: + print("-5$") + break + +barbut()