Skip to content

Built Klondike using AI powered by v0.dev. Not an endorsement of AI, not a dunk. Humans have had to dabble in this to get it to where it is now.

Notifications You must be signed in to change notification settings

Lewiscowles1986/klondike-keyboard

Repository files navigation

Klondike Keyboard

A Keyboard-controlled Klondike game, built with AI

Screen capture of the game board showing a classic Klondike or Solitaire game, with 7 columns of cards, ranging from one in the left-most to seven in the right-most, with all cards but the last in those 7 columns turned face-down so the card cannot be seen. At the top-right there is a 4 column foundation, sitting empty, and in the top-left is the waste pile, of cards face down, with no cards removed from the waste.

  • <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

Getting Started

Setup

  1. You must have NodeJS installed. This was developed using NodeJS 20
  2. You should have Git installed.
  3. Git clone using git clone https://github.com/LewisCowles1986/klondike-keyboard.git
  4. Change directory into the cloned folder cd klondike-keyboard
  5. Install the dependencies using npm ci

run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

Developing

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

Known bugs / areas of iteration

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.

Provenance

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:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Judgement (opinion)

Very impressed

Deploy on Vercel

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.

About

Built Klondike using AI powered by v0.dev. Not an endorsement of AI, not a dunk. Humans have had to dabble in this to get it to where it is now.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published