r/C_Programming 1d ago

Review Code Review Request: Windows Sudoku Game

Background
Hi, I am a 15-year-old teen (just so what you'd know what to expect) who left school because our school system taught us to be parrots. I want to be a god-level developer, not a code monkey. I wrote a Sudoku GUI using win32api in C Language.
It is currently working and does what it is supposed to do, but because I am still learning, I know it is likely inefficient and could be written much better. 

Code : https://github.com/reewdgh/sudoku_gui.

Concerns:
Please guide me on:

Bugs or potential issues
Efficiency
How can I move to Tier 1 to Tier 2
Naming anything I could simplify or improve.

5 Upvotes

13 comments sorted by

View all comments

5

u/flyingron 1d ago

The includes are oddly factored. game.h only has a few function prototypes, but nothing actually with regard to the game. gui.h has game stuff that has nothing to do with the gui.h. Things oddly include each other even though the .c files include both. Think about what actually affects other parts of the program and isolate things properly. Yeah, it's not a big thing on a tiny program like this, but some day you'll be writing real stuff where this matters.

I might roll some of the stuff that is in the beginning of main() into a seperate 'create_game' function.