Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==== Credit and information ==== #
- import random
- # CREATOR: https://pastebin.com/u/JumpYScriptsz
- # STATUS: finished!
- # check here for updates: https://pastebin.com/M7M7uwe5
- # new version out with devide and more questions
- # ====== ERRORS ====== #
- # -number of goes have to be above 0
- # -custom questions (range) can be broken sometimes with ranging between 2 numbers
- # -the "MODES" have to be typed exactly as they are written
- # variables #
- correct = 0
- incorrect = 0
- points = 0
- # main settings / modification #
- v = int(input("how many goes do you want: "))
- print("what mode do you want: ")
- print()
- print("======= MODES =======")
- print("easy")
- print("normal")
- print("hard")
- print("EXTREME")
- print("INSANE")
- print("custom")
- print()
- r = input(": ")
- # change the v numbers to what fits you
- if r == "easy": # e.g. 2 * 5
- v1 = 1 # from range 1
- v2 = 5 # to 5
- v3 = 1 # second range
- v4 = 5 # to 5
- elif r == "normal":
- v1 = 2
- v2 = 9
- v3 = 2
- fv4 = 12
- elif r == "hard":
- v1 = -8
- v2 = 13
- v3 = -8
- v4 = 12
- elif r == "EXTREME":
- v1 = -14
- v2 = 13
- v3 = -6
- v4 = 13
- elif r == "INSANE":
- v1 = -20
- v2 = 15
- v3 = -30
- v4 = 30
- elif r == "custom":
- v1 = int(input("enter the first number range: "))
- v2 = int(input("enter the second number range: "))
- v3 = int(input("enter a lower number than your first number: "))
- v4 = int(input("enter the second number range: "))
- else:
- print("not valid mode - restart the program")
- y = input("show answer? DISABLED D / ENABLED E: ") # type D or E to disable / enable this
- # random multiplication questions
- for t in range(1, 1+v):
- number = random.randint(v1, v2)
- number2 = random.randint(v3, v4)
- correctAnswer = number*number2
- print(number, "x", number2)
- i = int(input(""))
- if i == correctAnswer:
- if y == "E":
- print("")
- correct = correct + 1
- points = points + 225
- else:
- print("correct!")
- correct = correct + 1
- points = points + 115
- elif i != correctAnswer:
- if y == "E":
- print("")
- incorrect = incorrect + 1
- else:
- print("incorrect answer! answer is", correctAnswer)
- incorrect = incorrect + 1
- else:
- print("error occured")
- # statistics #
- questions = correct + incorrect
- total = correct / questions * 100
- print()
- print("======= STATISTICS =======")
- print()
- print("correct answers:", correct)
- print("incorrect answers:", incorrect)
- print("Total points gained:", points)
- print("number of goes:", v)
- print()
- print("ACCURACY:", total, "%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement