Jim's Depository

this code is not yet written

I'm pretty good at Klondike type solitaire, but I do not always win winnable hands. (No backtracking, all hands are winnable with unlimited backtracking.) After not feeling I was getting any better at winning winnable hands I decided what I needed was an indicator to show when I had "stepped off the path", when I had converted a winnable spread of cards to an unwinnable one. Not immediately finding such a program, I spent a day with an AI agent and wished one into existence.

Lessons learned:

  • There are solitaire card states where stepping off the golden path is just baffling. You can make what looks like the most obviously benign move and render it unsolvable. More disturbing there are places where you have a choice of two cards to move to a destination and one makes it unsolvable with no clear indication how you might choose one or the other. I fear that a human operable algorithm for perfect solvability is not achievable. But, hey, give it a shot! I have an app for that.
  • The AI wrote an entire polished solitaire app with real time solvability analysis just from my instructions and feedback. I was ready for a 1.0 release without ever having seen any of the code.
  • Having a knowledgable computer scientist is still useful, in talking to it about solvability I sped up its algorithms by about a factor of 1000.
  • Having a programmer with in depth knowledge of a platform and its capabilities is also an asset. The AI frequently chose ways of implementing which didn't take advantage of capabilites, for instance, when dealing a deck of cards it would use the "Task" system to delay and then deal the next card. This gives a deal subject to timing jerkiness. Encouraging it to use the animation system with delays built in to the animation gets a smooth, synchronized experience. But if you didn't have a programmer who had watched an unreasonable number of WWDC videos that approach would not have been explored.
  • I used Codex for most of the work. I let Claude help when Codex was on its marketing break. Claude seems a bit slower, though most of that feeling might be that it is less chatty while working. They both seemed to get the job done. The low end Claude gets a lot less work done before going on break compared to ChatGPT. Codex works better with Xcode 26.5, but I imagine they both do better with the Xcode beta, I just can't use that because I'm releasing to the store. Still, it might be worthwhile to develop mostly with the Xcode beta, then switch to the released Xcode when it is time to publish.

In any event, your can go to the iOS or macos app store and download Cassandra's Deal and try for yourself.

Image of solitaire game

Attachments

cassandrasdeal.png 535506 bytes