A Keyboard-controlled Klondike game, built with AI
<N>
New Game<D>
Draw card(s)<1>-<7>
Select nth column in tableau<W>
Select waste card<F>
Place card in Foundation<Esc>
De-select
- You must have NodeJS installed. This was developed using NodeJS 20
- You should have Git installed.
- Git clone using
git clone https://github.com/LewisCowles1986/klondike-keyboard.git
- Change directory into the cloned folder
cd klondike-keyboard
- Install the dependencies using
npm ci
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
Note
I made progress against several of these. It's surprising that, many were quite close at hand answers that just needed testing or a REPL to get right. If you see something with a ☑️ then it should mean it's done.
This is not provided to "dunk on" AI, but it does represent areas I feel I would focus on for further development.
- 3-card play is totally untested and I believe relies on the mouse
- You can only move an entire column from tableau
- Random uses JavaScript Math.random which does not take a seed
- Heavily coupled to ReactJS, Next, browser... IDK this feels like it should be playable in a console
- the game should not "need" a UI (helps testing)
- the game should be able to put on a face-lift
- Non-semantic HTML elements used
- No test suite
- No scoring or time display
- No saved game or ability to come back and resume play
- seed is now resumable
- command-queue would help add undo / redo, but also replay
- serialisation of command-queue + random seed could enable save
- de-serialisation and projection to state, could enable load
- I dont know that all generated games are complete-able
- I'm as-yet unsure about how to entice players to play more (borders on gambling) :laugh:
- I would like to de-couple controllers, and perhaps given a seed to predictably shuffle cards, like a command-pattern way to push actions to a stack, so the game can play-through
- There is no way to tell a player they've lost
- I'm pretty sure there is something messing with focus in this
- I'd like to play with Aural announcement to experiment with non-visual interface
- After completing the game, I was unable to use the N key, and had to hit the button for "New Game"
- I did not tab to it. I used a cursor.
This project was originally AI generated by v0.dev
I'd heard a lot of hype around it, and rather than try to prove how stupid AI is, or how smart I am... I Instead tried to see if it could solve known problems.
This is a Next.js project bootstrapped with create-next-app
. using Default instead of New York, because honestly I don't know what that meant.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Very impressed
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.