Skip to content
Sign upLog in
← Back to Community

[GAME] Spacebar clicker!

Profile icon
peternielsen112

Probably the simplest python program I've made in two minutes (plus another minute to try it out). Works like a charm. Counts the number of spacebar clicks in the user's preferred amount of time. Upvote please!
(EDIT) Also thanks to

@DynamicSquid
for helping me reduce the amount of code!

Voters
Profile icon
peternielsen112
Comments
hotnewtop
Profile icon
DynamicSquid

Cool! But I think you have a lot of unnecessary code:

import time, getch from colorama import Fore, init as f_init f_init(autoreset=True) times = float(input(Fore.BLUE + 'Enter the amount of time you want to have (in seconds, digits only)... ')) print(Fore.RED + 'Click the spacebar!') t1 = time.time() clicked = 0 while time.time() - t1 < times: get = getch.getch() clicked += 1 print(Fore.GREEN + f'You clicked {clicked} times in {times} seconds.')
Profile icon
peternielsen112

@DynamicSquid
Thanks! I'll get on that.