Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Roll-The-Dice/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Roll Dice Game for beginners
This program contains a simple 'Roll The Dice' game.<be>
You can use this program when playing any board game with dice.<be>

Step 1.
<b>Run the program</b> by entering below commands in terminal.
```
python main.py (in Windows)
```
```
python3 main.py (in Linux)
```

Step2.
<b>Select Choice</b> for getting the dice number.
```
Roll (y/n):
```
If you choose <b>'y'</b> then the program will give you a random number between 1-6.
Otherwise, it will end.

**_NOTE:_** : You can only get two times '6' consequently.

Enjoy the Game...!
27 changes: 27 additions & 0 deletions Roll-The-Dice/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from numpy import random

def get_num():
num = random.randint(1,7)
return num


while True:
choice = input("Roll (y/n): ")
if choice == ("y" or "Y"):
num = get_num()
print(num)
print()
if num == 6:
print("Again Rolled: ")
num2 = get_num()
print(num2)
print()

if num2 == 6:
print("Sorry you can only get 2 '6's")
print()

else:
print("Program Exited... Bye !")
break