repl.it
@AmeenShafeeq/

Prim Game Console

Python

No description

fork
loading
Files
  • main.py
  • nothing.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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
import random 
import sys
def quit():
  sys.exit()
def rod():
   a =random.randint(1,7)
   print(a)
   c = input("If u want to try again press ta else press q to quit")
   if c=="ta":
     rod()
   elif c == "q":
       sys.exit()
   else:
     c = input("If u want to try again press ta else press q to quit")
     if c=="ta":
       rod()
     elif c == "q":
       sys.exit()
     else:
       print("We are quitting you out of the program")
       sys.exit()
def sps():
  print("This is a  game in which you can respond by stone paper or scissor")

  a = random.choice(["stone","paper","scissor  "]) 
  s=input("Your Turn   ")
  print(a)
  if s == "stone"and a == "paper":
    print("You Loose") 
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
  elif s=="paper" and a == "stone":
    print("You win")      
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
  elif s=="scissor"and a=="paper":
    print("You win ") 
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
  elif s=="paper" and a=="scissor":
    print ("You Loose") 
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()  
  elif s=="stone"and a=="stone":
    print("its a tie")    
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
  elif s=="paper"and a=="paper":
    print("its a tie" ) 
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
  elif s=="scissor"and a=="scissor":
    print ("Its a ties") 
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
  elif  s=="stone "and a=="scissor"  :
    print("You Win")   
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
  elif s=="scissor"and a=="stone":
    print("You loose") 
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()     
  else:
    c = input("If u want to try again press ta else press q to quit")
    if c=="ta":
       sps()
    elif c == "q":
       sys.exit()
    else:
       print("We are quitting you out of the program")
       sys.exit()
           
def gtm():
  print("You have to guess the number which the computer[simple ai] thinks it will be more then 1 and less then 100")
  print("All the Best !")
  a=random.randint(1,100)
  b=str(a)
  s=input("what do you think")
  if s == b:
     print("you are right")
     c = input("If u want to try again press ta else press q to quit")
     if c=="ta":
       gtm()
     elif c == "q":
       sys.exit()
     else:
       print("We are quitting you out of the program")
       sys.exit()   
  else:
      print("The number is less then"+" "
      +str(a+10)+"  "+"and greater then"+str(a-10))
      p = input("Try Again ")
      if p == b:
        print("you win")
        c = input("If u want to try again press ta else press q to quit")
        if c=="ta":
          gtm()
        elif c == "q":
          sys.exit()
        else:
          print("We are quitting you out of the program")
          sys.exit()   
      else:
        print("the number is less then"+" "+str(a+5)+" "+"the number is greater then"+" "+str(a-5))
        q=input("This is your last chance")
        if q==b:
          print("You win")
          c = input("If u want to try   again press ta else press q to quit")
          if c=="ta":
            gtm()
          elif c == "q":
           sys.exit()
          else:
           print("We are quitting you out of the program")
           sys.exit()   

        else:
          print("you lost after three chances boo!!" )
          print("The number was"+" "+str(a))
          c = input("If u want to try again press ta else press q to quit")
          if c=="ta":
            gtm()
          elif c == "q":
            sys.exit()
          else:
            print("We are quitting you out of the program")
            sys.exit()   
def help():
  
    print("we have the following commands")
    print("Roll a dice[If you want to play this press a to continue to this game] ")
    print("Stone Paper Scissors[If you want to play this press b to continue to this game] ")
    print("Guess the number[If you want to play this press c to continue to this game] ")
    print("Help[If you want help press h to continue to this game] ")
    print("Quit[If you want to play this press q to continue to this game] ")
    a = input("What do you want to do")
    if a == "a":
       rod()
    elif a=="q":
      quit()
    elif a=="b":
      sps()
    elif a=="c":
      gtm()
    elif a=="h":
      help()  
    else:
      print("Didnt get you")  
                

command = input("command ")
if command =="Prim Games":
  print("Welcome to Prim Game")
  print("we have the following commands")
  print("Roll a dice[If you want to play this press a to continue to this game] ")
  print("Stone Paper Scissors[If you want to play this press b to continue to this game] ")
  print("Guess the number[If you want to play this press c to continue to this game] ")
  print("Help[If you want help press h to continue to this game] ")
  print("Quit[If you want to play this press q to continue to this game] ")
  a = input("What do you want to do")
  if a == "a":
    rod()
  elif a=="q":
   quit()
  elif a=="b":
    sps()
  elif a=="c":
    gtm()
  elif a == "h":
    help()
  else:
    print("didnt get you")