Skip to content

Commit 88d04e7

Browse files
committed
First steps with RPS game.
1 parent 2d33583 commit 88d04e7

File tree

7 files changed

+58
-0
lines changed

7 files changed

+58
-0
lines changed

code/06-organizing-code-with-functions/rocks-game/.idea/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/06-organizing-code-with-functions/rocks-game/.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/06-organizing-code-with-functions/rocks-game/.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/06-organizing-code-with-functions/rocks-game/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/06-organizing-code-with-functions/rocks-game/.idea/rocks-game.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/06-organizing-code-with-functions/rocks-game/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
print("---------------------------")
2+
print(" Rock Paper Scissors v1")
3+
print("---------------------------")
4+
5+
player_1 = input("Enter player 1's name: ")
6+
player_2 = input("Enter player 2's name: ")
7+
8+
rolls = ['rock', 'paper', 'scissors']
9+
10+
roll1 = input(f"{player_1}, what is your roll? [rock, paper, scissors]: ")
11+
if roll1 not in rolls:
12+
print(f"Sorry {player_1}, {roll1} is not a valid play!")
13+
14+
roll2 = input(f"{player_2}, what is your roll? [rock, paper, scissors]: ")
15+
if roll2 not in rolls:
16+
print(f"Sorry {player_2}, {roll2} is not a valid play!")
17+
18+
19+
print(f"{player_1} rolls {roll1}")
20+
print(f"{player_2} rolls {roll2}")
21+
22+
# Test for a winner

0 commit comments

Comments
 (0)