PROJECT NAME: Sudoku-Zig
Full Sudoku implementation with multiple front ends: ascii, ansi, web, android. See GitHub - mwigzell/sudoku-zig: Zig implementation of basic Sudoku features multiple front ends. · GitHub.
My intention was to learn Zig and also to see whether AI is reliable enough.
Supported Zig versions: 0.17
AI / LLM usage disclosure:
I originally used a local LLM on a RTX 3090, but as the code grew it did not have a large enough context window. So I switched to cloud LLM, currently using deepseekv4-pro. This is not vibe coded.
Coding method
I used the Matt Pocock workflow and TDD slices of vertical code. I found that the AI really has no idea, and will find the “easy” way out of any task. It of course doesn’t read the codebase and retain it, so it doesn’t operate on the entire project when it thinks.
That is the downside for sure. I was able to get a set of rules and procedures and mechanical tests around it, to the point where now I feel in control of it.
My Zig knowledge has grown tremendously (a major goal), and my understanding of how an AI might be an augmentation to the software engineering process also. It is a glorified refactoring and template tool, needing full direction from a software engineering point of view.
Design
The design of the app has a game engine that is totally UI agnostic, and via a “command flow” strategem implemented differently by each front end it is able to support both a simple “ascii” terminal and web based frontends (so far). The showcase front end is the android app.
Major Issue With LLM
The major issue I encountered was in having the AI take heed of the command flow abstraction.
It often solved things for just one or the other front end. I finally figured out a mechanical way to enforce parity across the frontends, using a kind of test code that runs each front end on the same command set, noting the call and answer for each, and enforcing parity.
I fully admit that it is a treacherous balance, and at this point I need to dig into writing Zig more actively, having seen a fair sampling of what can be done with it.
Viable?
Still I do feel a certain satisfaction at producing it, the build system and methodology work. There is more to be done on that score: The “Sandcastle” tool from the Pocock workflow has yet to prove itself.
This tool is a kind of autonomous agent, and I have created an approach whereby an issue/spec is broken into a set of steps, and a list of acceptance criteria. Each step is run by a separate agent, with a separate reviewer, and one final agent reviewer at the end.
At the moment the step/reviewer doesn’t iterate which is a serious weakness I am going to rectify.
Conclusion
The approach has born fruit on several occasions that give me hope it is a viable way forward. The Android app is submitted to the Google Play Store and I am soliciting testers to get it past that front door. Help appreciated, here is a link to join the tester group: https://play.google.com/store/apps/details?id=com.wigzell.sudoku_zig