Coding with Claude AI

Coding with Claude AI

So I wanted to see what AI coding can do and started claude with /plan

Make a clone of Bejeweled game to run on Linux

It laid out the requirements, made a to-do list and suggested Rust + bevy for the implementation. I agreed.   It asked would you like me to build it and off we go.

Initial commit didn't have tests, executed but the grid for the gems was offset.   I looked at the code and figure the something was a miss with the layout and asked Claude

Misaligned
Fix grid positioning to fit within window bounds and add tests

Claude said bevy's coordinates for 0,0 was the center of the window and fixed rendering the grid inside the window.    This turned into a series of follow-up  prompts by me to fix grid calculations.   All the code was done by Claude with my prompts.   The commit details all generated by Claude and pretty complete.

The game is incomplete and the README.md has suggestions for enhancements but first focusing on the core logic.   There is still some issue with match removal that seems to mess up the grid of gems from a logic standpoint, not visual.  I asked to write a test to make sure the grid shows expected gems after a successful match.   I'll dive in later to fix remaining issues and maybe polish the app up. I am impressed with AI handling the prompts for bugs which is what I wanted to get out of this to see how robust AI is in analyzing root cause. Now when I did the first prompt it fixed the rendering but not the other areas, which caused subsequent prompts to fix those areas as well.

I absolutely love the detailed commit messages. They are a thing of beauty, like this example.

Total cost was about $10.   When I generated the plan it said estimate for a meat bag coder was 20 days.

Resulting repository https://gitlab.com/geoffcorey/match3/-/commits/master

Update:

Looking through the commits you can see there was several issues with coordinate source of truth. Once that was resolve the major bug was tiles/gems were bleeding. There was a lot of back and forth with Claude and I screenshot the game and told Claude you can see the bug here.

Claude created debug lines and started the game and did following modifications until it was fixed. It was impressive. Here is the commit

Experiment #2

I used Opus to /plan a poker site with the plan prompt of

A real-time multiplayer poker website with user accounts, admin-defined tables, chip tracking, and player-to-player transfers. Supports Texas Hold'em, 5-Card Stud, 7-Card Stud, Pot Limit Omaha, and Big-O Hi/Lo.

Asked various library questions to use and at the end it asked if I wanted claude to implement it. I screwed up and said yes without changing the model from Opus to Claude so after some client interaction bug fixing the whole thing cost me more . . . about $25.

One bug still there is no matter which game I setup on a table, it is still just Texas Hold'em. I will have to follow up and explain how the other games are played.

Generated code was all done by Opus at https://gitlab.com/geoffcorey/poker