|
1 | | -import random |
| 1 | +import random |
2 | 2 | import time
|
3 | 3 |
|
4 | 4 | def wait():
|
5 | 5 | time.sleep(2.0)
|
6 | 6 |
|
7 | 7 | print("*"*50)
|
8 | | -print("Welcome to Dice Game") |
9 | | -print("A game of Luck") |
| 8 | +print("Welcome to the Dice Game!") |
| 9 | +print("A Game of Luck") |
10 | 10 | print("*"*50)
|
11 | | -print("Roll the Dice and If 6 Come, You will Win :)") |
| 11 | +print("Roll the die and if you roll a lucky six; You Win! :)") |
12 | 12 |
|
13 | 13 | while (True):
|
14 | | - user_input = input("Press 1 to role Dice\n") |
15 | | - |
| 14 | + user_input = input("Press 1 to role Die\n") |
| 15 | + |
16 | 16 | if(user_input == '1' or user_input == 1):
|
17 | 17 | num = random.randint(1,6)
|
18 | | - print("\nRolling Dice") |
| 18 | + print("\nRolling the Die") |
19 | 19 | wait()
|
20 | 20 | if(num == 6):
|
21 | 21 | print("You got",num)
|
22 | | - print("You won\n") |
| 22 | + print("Yay! You won!\n") |
23 | 23 | else:
|
24 | | - print("\nYou got",num,"\nYou Lost\n") |
| 24 | + print("\nYou got",num,"\nAww! You Lost!\n") |
25 | 25 |
|
26 | 26 | choice = input("Press Y to Play again\nPress N to Exit Game\n")
|
27 | | - |
| 27 | + |
28 | 28 | if (choice == 'Y' or choice == 'y'):
|
29 | 29 | continue
|
30 | 30 | elif (choice == 'N' or choice == 'n'):
|
31 | 31 | break
|
32 | 32 | else:
|
33 | | - print("\nPlease Enter valid Choice") |
34 | | - |
| 33 | + print("\nPlease Enter Y/N.") |
| 34 | + |
35 | 35 | else:
|
36 | 36 | print("\nNot a valid option")
|
0 commit comments