Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """Try and guess what the computer rolled with two dice! Woah!"""
- """
- Goals:
- - Add a score system
- - Add a min value w/ appropriate messages
- """
- from random import randint
- from time import sleep
- def get_user_guess():
- guess = int(input("Guess what the computer rolled with two dice: "))
- return guess
- def roll_dice(number_of_sides):
- first_roll = randint(1, number_of_sides)
- second_roll = randint(1, number_of_sides)
- max_val = number_of_sides * 2
- print("The max guess is: %d" % max_val)
- guess = get_user_guess()
- if guess > max_val:
- print("That's over the max guess bruh lmao")
- else:
- print("Rolling...")
- sleep(2)
- print("First roll: %d" % first_roll)
- sleep(1)
- print("Second roll: %d" % second_roll)
- sleep(1)
- total_roll = first_roll + second_roll
- print("Computer got: %d" % total_roll)
- print("Result...")
- sleep(1)
- if guess > total_roll:
- print("You won bruh!")
- else:
- print("Damn you lost")
- roll_dice(6)
Advertisement
Add Comment
Please, Sign In to add comment