repl.it
@hoop4life/

rock paper scissors correct v

Python

No description

fork
loading
Files
  • main.py
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#imports
from tinytext import tinytext
from termcolor import colored
import time
import random
import replit  
#stupid intro
print(tinytext("Copyright HOOP4LIFE Studios 2019"))
time.sleep(2)
print(tinytext("Illegal copyright will result in a fine of $5000 and/or up to 5 years in federal prison."))
time.sleep(2)
replit.clear()
#lame intro
print(colored("This is a rock, paper, scissors game...",'cyan'))
time.sleep(1)
print(colored("Created by...",'cyan'))
time.sleep(2)
print(colored("HOOP4LIFE",'cyan'))
time.sleep(3)
replit.clear()
#real intro
print(colored("In this game, you get to pick rock, paper, or scissors. The computer will pick a random one.",'green'))
time.sleep(1)
print(colored("If you want to see the points, type in, 'points'.",'green'))
time.sleep(1)
print(colored("Last, if you want to stop the game, press quit."))
time.sleep(2)
replit.clear()
#variables
c = 0
p = 0
g = 0
r = ('rock','paper','scissors')
#functions
def win():
  print(colored("You win!",'blue'))
  time.sleep(1)
  replit.clear()
  p = p + 1
def loss():
  print(colored("You lost",'red'))
  c = c + 1
  time.sleep(1)
  replit.clear()
def tie():
  print(colored("It was a tie.",'yellow'))
  time.sleep(1)
  replit.clear()
def points():
  if c > p:
    print("I am winning.")
    time.sleep(1)
    print("I have",c,'points.')
    time.sleep(1)
    print("You have",p,'points.')   
    time.sleep(1)
    replit.clear() 
  if c < p:
    print("You are winning.")
    time.sleep(1)
    print("You have",p,'points.')
    time.sleep(1)
    print("I have",c,'points.')   
    time.sleep(1)
    replit.clear() 
def quit():
  g = g + 1
while g == 0:
  a = random.choice(r)
  z = input("Do you want rock, paper, or scissors?")
  #if rock
  if z == 'rock':
    if a == 'rock':
      print("rock")
      (tie)
    if a == 'paper':
      print("rock")
      (loss)
    if a == 'scissors':
      print("rock")
      (win)
  # if paper
  elif z == 'paper':
    if a == 'paper':
      print("paper")
      (tie)
    if a == 'scissors':
      print("paper")
      (loss)
    if a == 'rock':
      print("paper")
      (win) 
# if paper
  elif z == 'scissors':
    if a == 'scissors':
      print("scissors")
      (tie)
    if a == 'rock':
      print("scissors")
      (loss)
    if a == 'paper':
      print("scissors")
      (win) 
  #if points
  elif z == 'points':
    (points)
  elif z == 'quit':
    print(colored("Thanks for playing!",'magenta'))
    if c > p:
      print("You lost.")
      time.sleep(1)
      print("I got",c,'points.')
      time.sleep(1)
      print('You got',p,'points.')
      time.sleep(1)
      replit.clear
    elif c < p:
      print("You won.")
      time.sleep(1)
      print("You got",p,'points.')
      time.sleep(1)
      print("I got",c,'points.')
      time.sleep(1)
      replit.clear
  else:
    print(colored("INVALID INPUT!",'green'))
?