The first game I made was Sudoku using Python. It was also the first time I used the Pycharm IDE. Not going to lie, I was overwhelmed by all the features in Pycharm because I’ve only coded in IDLE, and IDLE was super easy to use. Besides the crazy amount of features in Pycharm, there were also multiple Python script files with hundreds of lines of code. Luckily, I was only required to write code for the game logic, and not game controls, graphics, etc.
The game was a 9×9 puzzle, and it always amazes me knowing there are 16×16 puzzles or even 25×25 puzzles. The game logic was not too complicated since I played the game before, so I was somewhat familiar with it. The task was to go through every row, column, and grid to see if a specific number already exist in the same row, column, or grid, and eliminate that number if it already exist. If there’s only one number left after all the other possible numbers are eliminated, then that number is the correct choice. What’s cool was that this was easily implemented using recursion.
Since everything else was provided by my teacher, I was able to finish the game quickly and got it running. Besides puzzles that only start with a few numbers, the puzzle solver I implemented was able to solve puzzles under 3 seconds, which is super cool because no human can do anything like that.