The original TikTakToe from the initial commit was from a previous excercise in Data Science. I started with that version and improved the code cleanness with every commit.
The changes in each steps are rougly described below.
- File restructuring
- Splitted game logic from user input and output [SoC]
- improved meaning of
player_one:boolean
==>current_player: number
variable - extracted switching players to own method
- improved logic for game state variables
win:boolean
==>game_over: number
- seperated "doing" from "calling" code regarding these variables
- seperated player characters (X, O, or whatever character the user could choose from) from the actual game logic. Characters are now handeled by the UI class [SoC]
- general refactoring
- code order now fitting better to the game logic
- added comments for better understanding of each function