-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharcade.py
More file actions
40 lines (32 loc) · 1.25 KB
/
arcade.py
File metadata and controls
40 lines (32 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
import rps
import guess_numbers
def arcade(name):
repeat_visitor = False
while True:
if repeat_visitor == False:
player_input = input("Welcome to the Arcade! 🤖 \n\n Please choose a game: \n 1 = Rock Paper Scissors \n 2 = Guess my number\n\n or enter 'x' to exit the Arcade\n").lower()
repeat_visitor = True
elif repeat_visitor == True:
player_input = input("Welcome back to the Arcade! 🤖 \n\n Please choose a game: \n 1 = Rock Paper Scissors \n 2 = Guess my number\n\n or enter 'x' to exit the Arcade\n").lower()
if player_input == "1":
game = rps.rps(name)
game()
elif player_input == "2":
guess_numbers.guessing_game(name)
elif player_input == "x":
sys.exit(f"Bye name")
else:
print("Please enter 1 or 2")
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="provides a personal greeting"
)
parser.add_argument(
"-n", "--name", metavar="name",
required=True, help="the name of the person to greet."
)
args = parser.parse_args()
arcade(args.name)
print("Thank you for playing at the arcade!")