Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Assignment 1 Question 3
- Date Written: March, 2019
- Author: Russell Bloxwich
- ID:692618785
- Description: Dice rolling game
- """
- import random
- current_score = 0
- banner_text = "REACH 100 IN THREE ROUNDS! Initial total: 0"
- banner_stars = "*" * int(len(banner_text))
- print(banner_stars)
- print(banner_text)
- print(banner_stars)
- for x in range(0, 3):
- dice_array = random.randrange(1,7), random.randrange(1,7), random.randrange(1,7), random.randrange(1,7), random.randrange(1,7)
- print("Round " + str(x) + ":")
- print("Your dice:", dice_array[0], dice_array[1], dice_array[2], dice_array[3], dice_array[4])
- tens = dice_array[int(input("Tens?")) - 1] * 10
- units = dice_array[int(input("Units?")) - 1]
- dice_value = tens + units
- current_score += dice_value
- print("Dice Value:", dice_value)
- print("Your current total:", current_score)
- print("*****************************")
- print("Your final score:", current_score)
- print("You are", abs(100 - current_score), "away from the goal")
- print("*****************************")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement