Hey everyone!
For this portfolio project, I decided to make a single-player Python terminal game of Scrabble. The point of the program is for the player to type as many words as possible within ten seconds, and only with the 7 letters that the program randomly picks.
I tried to make this program to be as clean and bug-free as possible, but I wouldn’t be the least bit surprised if I made some oversights in my code. I would be grateful if any of my peers could point out the flaws in this game.
Reorganize your code. Put your code in that sequence: imports, function definitions, main code. With this structure it will be easier to read. Currently you have variables initialization and player name input (lines 9-17) between imports and functions.
Use function scramble_list for initial letters generation too (instead of lines 15-17).
About timer. In your code timer is not background in the full sense. Real background timer will end the game even without user input. In source StackOverflow post used a OS signals, this is advanced topic.
Hello!
1 and 2. First off, thank you so much for your feedback. I knew my code was a little ugly, but I couldn’t figure out why. I had no idea it would be a matter of organization. The same goes for finding a better use of my scramble_list function.
3. I was thinking of using the lower method. I don’t know why I didn’t go through with it. That was silly of me
4. I honestly didn’t think I would need to use OS signals because I was under the impression that it would only produce a message. That was another silly oversight on my part
5. I was wondering on how to properly credit the creator of the library beyond simply linking their github page. I never knew it was common practice to add a txt file to list the requirements for the program. I hope that would be the last of my mistakes. I’ll be sure to add that to the repository.
PS Your English is just fine! I understood everything you said
All that I pointed before are not errors or silly decisions. This is only recommendations and best practices.
For example usage of OS signals is not neccessary in that project. I only clarified your comment in the code for you to better understanding what is real background timer.