r/pythontips • u/[deleted] • Sep 05 '22
Python3_Specific My first project
This is my first project can you please tell me your opinions:
https://github.com/khmdvjamshid/Tic-tac-toe-game/blob/main/tic-tac-toe
1
1
2
u/limoonen Sep 06 '22
As first project it looks pretty clean, good job!
I found couple things to improve:
Add asserts to make sure the input from users are valid if not add messages to make clear what is expected.
I really don't understand why are you using indexing from 1 for board positions (I know it's counterintuitive at the beginning but it's important paradigm to grasp and use).
The function win_check could be rewrited with for loop logic to make it more elegant.
Keep working, as a next step you could try add game mode for one player vs bot.
13
u/uSrNm-ALrEAdy-TaKeN Sep 05 '22
Looks like a nifty cli based game and the code is very readable (to me at least).
If you want to take it to the next level and make a window/user interface for it, consider looking into pygame