@mkhoi/

BRUTAL NUMBER GUESSING GAME!!!

Python

Be ready...

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.011086659314253566","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHJlcGxpdAppbXBvcnQgcmFuZG9tCmltcG9ydCB0aW1lCgpyZXBsaXQuY2xlYXIoKQpkZWYgZ2FtZSgpOgogIHByaW50ICgiR2VuZXJhdGluZy4uLiIpCiAgbnVtID0gcmFuZG9tLnJhbmRyYW5nZSgxLDEwMDEpCiAgdGltZS5zbGVlcCgyKQoKICBwcmludCAoIk9LISBZb3UgaGF2ZSBhIG51bWJlciBvZiBndWVzc2VzIGFuZCB0aGUgbnVtYmVyIHlvdSBoYXZlIHRvIGd1ZXNzIGlzIGJldHdlZW4gMSBhbmQgMTAwMCAoaW5jbHVkaW5nIDEgYW5kIDEwMDApIikKICB0aW1lLnNsZWVwKDEpCiAgcHJpbnQgKCJDaG9vc2UgeW91ciBnYW1lbW9kZToiKQogIHByaW50ICgiMS5zZW1pLWdvZCAoMSBndWVzcykiKQogIHByaW50ICgiMi5ub3JtYWwgbW9kZSAoMTAgZ3Vlc3NlcykiKQogIHByaW50ICgiMy5zaHkgZ3V5ICg1MCBndWVzc2VzKSIpCiAgZ2FtZW1vZGUgPSBpbnB1dCgiIikKICAgCiAgaWYgZ2FtZW1vZGUgPT0gIjEiOgogICAgbnVtcCA9IGludChpbnB1dCgiPiIpKQogICAgdGltZS5zbGVlcCgwLjUpCiAgICBpZiBudW1wID09IG51bToKICAgICAgcHJpbnQgKCJUaGF0J3MgcmlnaHQhIFlvdSB3aW4hIikKICAgIGVsc2U6CiAgICAgIHByaW50ICgiTm9wZSEgWW91IGxvc2UhIikKICAgICAgdGltZS5zbGVlcCgxKQogICAgcHJpbnQgKCJDbGljayBSdW4gYWdhaW4gdG8gcGxheSBhZ2FpbiEiKQogIGVsaWYgZ2FtZW1vZGUgPT0gIjIiOgogICAgZm9yIGd1ZXNzIGluIHJhbmdlKDEsMTEpOgogICAgICBwcmludCAoIkd1ZXNzICVkIiUgZ3Vlc3MpCiAgICAgIG51bXAgPSBpbnQoaW5wdXQoIj4iKSkKICAgICAgdGltZS5zbGVlcCgwLjUpCiAgICAgIGlmIG51bXAgPT0gbnVtOgogICAgICAgIHByaW50ICgiV09XISBUaGF0J3MgcmlnaHQgcGFsISIpCiAgICAgICAgYnJlYWsKICAgICAgZWxzZToKICAgICAgICBwcmludCAoIk5vcGUiKQogICAgICAgIHRpbWUuc2xlZXAoMSkKICAgICAgZ3Vlc3MgPSBndWVzcyArIDEKICAgIHByaW50ICgiQ2xpY2sgUnVuIHRvIHBsYXkgYWdhaW4hIikKICBlbGlmIGdhbWVtb2RlID09ICIzIjoKICAgIGZvciBzaHllciBpbiByYW5nZSgxLDUxKToKICAgICAgcHJpbnQgKCJHdWVzcyAlZCIlIHNoeWVyKQogICAgICBudW1wID0gaW50KGlucHV0KCI+IikpCiAgICAgIHRpbWUuc2xlZXAoMC41KQogICAgICBpZiBudW1wID09IG51bToKICAgICAgICBwcmludCAoIlRoYXQncyBwcmV0dHkgZ29vZCBmb3IgYSBzaHllciAoamssIG5vdCBtZWFuaW5nIHRvIGJlIG1lYW4sIG9rPykiKQogICAgICAgIHByaW50ICgiWW91IHdpbiEiKQogICAgICAgIGJyZWFrCiAgICAgIGVsc2U6CiAgICAgICAgcHJpbnQgKCJOb3BlIikKICAgICAgICB0aW1lLnNsZWVwKDEpCiAgICAgIHNoeWVyID0gc2h5ZXIgKyAxCiAgICBwcmludCAoIkNsaWNrIFJ1biB0byBwbGF5IGFnYWluISIpCiAgICAgIAoKCmdhbWUoKQogIAogIAoKCgoKICAKCg=="},"asBuffer":null},"loaded":true}}
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
import replit
import random
import time

replit.clear()
def game():
  print ("Generating...")
  num = random.randrange(1,1001)
  time.sleep(2)

  print ("OK! You have a number of guesses and the number you have to guess is between 1 and 1000 (including 1 and 1000)")
  time.sleep(1)
  print ("Choose your gamemode:")
  print ("1.semi-god (1 guess)")
  print ("2.normal mode (10 guesses)")
  print ("3.shy guy (50 guesses)")
  gamemode = input("")
   
  if gamemode == "1":
    nump = int(input(">"))
    time.sleep(0.5)
    if nump == num:
      print ("That's right! You win!")
    else:
      print ("Nope! You lose!")
      time.sleep(1)
    print ("Click Run again to play again!")
  elif gamemode == "2":
    for guess in range(1,11):
      print ("Guess %d"% guess)
      nump = int(input(">"))
      time.sleep(0.5)
      if nump == num:
        print ("WOW! That's right pal!")
        break
      else:
        print ("Nope")
        time.sleep(1)
      guess = guess + 1
    print ("Click Run to play again!")
  elif gamemode == "3":
    for shyer in range(1,51):
      print ("Guess %d"% shyer)
      nump = int(input(">"))
      time.sleep(0.5)
      if nump == num:
        print ("That's pretty good for a shyer (jk, not meaning to be mean, ok?)")
        print ("You win!")
        break
      else:
        print ("Nope")
        time.sleep(1)
      shyer = shyer + 1
    print ("Click Run to play again!")
      


game()