![]() |
|
[Python] Python Typing Game - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Python Typing Game (/showthread.php?tid=5845098) |
Python Typing Game - WhiteTiger. - Jun 5, 2018 For those who are bored: here is a simple typing game. Best experience if played directly in command prompt. To do this; go to the path where you saved the file and type the following: Code python main.pyIf Python isn't recognized as a command make sure you add Python to the PATH environmental variable. Here's the main.py you can copy paste: Code import time(If you're not on windows: change 'cls' to 'clear') I also do realize that this doesn't give your real wpm because of the random strings but I do think it's still a great time waster. Feel free to give feedback/share/modify. Kind regards, ~WT RE: Python Typing Game - koolkid - Jun 6, 2018 well regarding your code you could make it more AI functionality to it by instead of the user changing the cls to clear you could write and extra 4 lines of code to check the os and switch it . PHP Code i hope u get the concept RE: Python Typing Game - WhiteTiger. - Jun 6, 2018 (Jun 6, 2018 05:03 AM)koolkid Wrote: well regarding your code you could make it more AI functionality to it by instead of the user changing the cls to clear you could write and extra 4 lines of code to check the os and switch it . Thanks for your feedback. I changed it now. I also came to the conclusion that the time.clock() doesn't work in Unix as I thought it would making this game "unplayable" in Linux. You can play but the time drops with 0.001 seconds every second or so. Any proper way to fix this other then to write a time functions specific for Linux? Thanks in advance, ~WT RE: Python Typing Game - koolkid - Jun 6, 2018 write the function for linux and call it if the os is linux. also instead of generating random string, u could use a list of actual words. |