Skip to content

Commit 6460cad

Browse files
Merge pull request prathimacode-hub#422 from bindaldhara/main
Rolling Dice game added
2 parents 6739d5f + 2825460 commit 6460cad

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed
70.2 KB
Loading
94.8 KB
Loading

PyGamesScripts/Rolling Dice/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Rolling a dice
2+
Rolling dice Game is a python program i.e, developed in python programming language using random module and some user inputs.
3+
4+
### About the game
5+
- It's a basic python program which asks the user to enter a number from 1 to 6.The user have to enter the number twice.If sum of the numbers is divisible by 2 then the user will win the game else will lost the game..
6+
7+
### How to play?
8+
- Enter a number from 1 to 6.
9+
-Again it asks the user to enter a number.
10+
-It then prints the numbers.
11+
-If the sum of two numbers entered is even then the user will win.
12+
-If the sum is odd then the uer will lose the game.
13+
14+
### Requirements
15+
- Your computer should have Python 3.
16+
- If your computer don't have Python you can download it from google.
17+
- Run the code.
18+
-Have fun!
19+
20+
### Screenshot of the game
21+
![screenshot](Images/Screenshot_1.jpg)
22+
![screenshot](Images/Screenshot_2.jpg)
23+
24+
## Author
25+
Dhara Bindal
26+
username:bindaldhara
27+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import random
2+
die1 = int(input("Enter a value from 1 to 6:"))
3+
4+
die2 = int(input("Enter a value from 1 to 6:"))
5+
6+
print(die1, die2) #prints the value of die
7+
8+
print(die1 + die2)#prints the sum of the numbers
9+
10+
11+
if (die1 + die2) %2==0:
12+
print("You win!")
13+
14+
else:
15+
print("you lost")
16+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Libraries inclued : random

0 commit comments

Comments
 (0)