C playground
My C workshop and coursework exercises from 2019, brought back to life: one shared build, tests, fixes, and a Tetris autoplayer that I taught to play better with the cross-entropy method.
Trained weights more than tripled the median lines cleared.
The autoplayer reads the real board, searches every reachable landing spot with breadth-first search, and scores each one on cleared lines, stack height, holes and unevenness. Hand-picked weights are the baseline; the cross-entropy method learned better ones on separate training, validation and test seeds. On 100 test seeds, capped at 1,000 pieces, median lines cleared went from 83.5 to 259.5 and the mean from 117 to 248. The learned weights won on 76 seeds, tied on 1 and lost on 23 (a paired bootstrap puts the gain at +99 to +163 lines).
Games, fractals and the classics.
Nested tic-tac-toe on a board of boards, Sierpinski triangles and carpets, sprite animation with Allegro 5, flood fill over a grid, and Fibonacci three ways: naive recursion, iteration, and 2×2 matrix powers in logarithmic time.
C99 and CMake, with regression tests and address, leak and undefined-behaviour checks in CI. The exercises grew from a C workshop and coursework, with starter code and reference solutions kept alongside my own work; the original course files are kept but excluded from the licence, since the split was never recorded. Code and the Tetris training report.