Add files via upload

This commit is contained in:
2023-02-02 11:51:25 +03:00
commit bdd6709ba3
2 changed files with 75 additions and 0 deletions

34
main.py Normal file
View File

@ -0,0 +1,34 @@
#imports
import keyboard as kb
import time
import random
#variables
#functions
def react(key):
while True:
print('Press shift to start.')
kb.wait("shift")
time.sleep(random.uniform(0.5, 5))
print('uwu')
startcounter = time.monotonic()
kb.wait("shift")
endcounter = time.monotonic()
print('Reaction time is {:>9.4f}'.format(endcounter - startcounter))
time.sleep(0.5)
if(kb.is_pressed(key)):
print('Closing game. Thanks for playing.')
main()
#main
def main():
print('Choose the game:')
print('React')
s = input()
if (s == 'react' or s == 'React'):
react('ctrl')
main()