Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """comment"""
- from random import randint
- from time import sleep
- def get_user_guess():
- user_guess = int(raw_input("Guess a number:"))
- return user_guess
- def roll_dice(number_of_sides):
- first_roll = random.randint(1, number_of_sides)
- second_roll = random.randint(1, number_of_sides)
- max_val = number_of_sides * 2
- print "The maximum is" + str(max_val)
- time.sleep(1)
- user_guess = get_user_guess()
- if user_guess > max_val:
- print "That number is too high"
- return
- else:
- print "Rolling"
- time.sleep(2)
- print "The first roll is %d" % (first_roll)
- time.sleep(1)
- print "The second roll is %d" % (second_roll)
- total_roll = first_roll + second_roll
- print "The total of both rolls is %d" % (total_roll)
- print "Result..."
- time.sleep(1)
- if user_guess > total_roll:
- print "you won"
- return
- else:
- print "you lost you fucking swine"
- return
- roll_dice(6)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement