repl.it
@1Ethan/

RockPaperScissors

Python

'RockPaperScissors' is just a simple game, coded in the most efficient way and has NO loop for simplicity, enjoy..

fork
loading
Files
  • main.py
main.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Welcome to one of the MOST basic RockPaperScissor games going..
# Rock beats scissors, scissors beats paper, paper beats rock.
# No loop for simplicity

import random
import time

Bot = ["Rock","Paper","Scissors"]

print("Welcome to 'RockPaperScissors'. ")
name = input("What is your name? ")
time.sleep(1)
print("Hello",name,"!")
time.sleep(1)
print("--------------------------")
ready = input("Ready to play RockPaperScissors? ")
time.sleep(1)
if ready == "yes" or ready == "Yes" or ready == "y" or ready == "YES" or ready == "Ye":
  print("Okay, we will now begin.")
elif ready == "no" or ready == "No" or ready == "N" or ready == "NO" or ready == "nO":
  print("You have said you are not ready, program terminating.")
  time.sleep(1)
  raise Exception("You have said you are not ready, program terminating.")
else:
  print("Sorry, that type of input wasn't recognised/supported.")
  time.sleep(1)
  raise Exception("Sorry, that type of input wasn't recognised/supported.")

time.sleep(1)
play = input("What would you like to play? R,P,S? ")
botplay = random.choice(Bot)

if play == "R" or play == "r":
  time.sleep(0.6)
  print("You played rock.")
  if botplay == "Paper":
    print("You lose! The bot played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  elif botplay == "Scissors":
    print("You win, the bot played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  elif botplay == "Rock":
    print("Tie! The bot ALSO played rock.")
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  else:
    print("An error occured, sorry.")
    time.sleep(1)
    print("Please message/report this to Ethan asap with full details.")

elif play =="P" or play == "p":
  time.sleep(0.6)
  print("You played paper.")
  if botplay == "Rock":
    print("You win! The bot played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  elif botplay == "Scissors":
    print("You lose! The bot played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  elif botplay == "Paper":
    print("Tie! the bot ALSO played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  else:
    print("An error occured, sorry.")
    time.sleep(0.8)
    print("Please message/report this to Ethan asap with full details.")

elif play =="S" or play == "s":
  time.sleep(0.6)
  print("You played scissors.")
  if botplay == "Rock":
    print("You lose! The bot played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  elif botplay == "Paper":
    print("You win! The bot played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  elif botplay == "Scissors":
    print("Tie! the bot ALSO played",botplay)
    time.sleep(1.5)
    raise Exception("Thanks for playing 'RockPaperScissors'.")
  else:
    print("An error occured, sorry.")
    time.sleep(0.8)
    print("Please message/report this to Ethan asap with full details.")
Fetching token
?