This, admittedly very basic, Chess game was built almost entirely using Cursor.AI. I didn't write a single line of code (so far!), so everything here was generated as a result of various AI prompts and interactions, all with the "Cursor" macOS app. The only exception are the images of the pieces themselves. I pulled those from somewhere (maybe wikimedia?) and renamed them to names the AI had requested. Cursor also made the asset catalog entries, though in looking at it now, it seems odd that the images themselves are just in the root and not down in the Resources folder
- Clone this repo
- Open the Package.json in Xcode
- Make the destination your Mac, and then do Build and Run (Command-R)
Note: We should be able to run this from the build script or using "swift build", but for some reason when I do that, the Assets.xcassets doesn't get processed into a .car file, and SwiftUI can't find any of the images. What's up with that? Anybody know why?
Anyway, I'm placing this initial version here as a point-in-time example of what current AI coding tools can do.
-
Well, White goes first of course, but the computer won't make the first move, so right now you need to move the white piece first, and then move a black piece. After that, white will take its turn automatically.
-
To move, you need to click on the piece you want to move, then click on the new square. However, there's no way to reset the selected piece, so once you've clicked one, you HAVE to move that piece.