A cribbage game based off of Wordle. Play at cribdle.com
TODO: shorten and write good intro
In a two player game of cribbage, each player receives six cards. They must choose to keep four and discard two, putting them in the crib of the player who dealt.
In Cribdle, you are given a random hand and have to decide what to discard. Your opponent is receiving the crib, so you don't want to throw away good cards just to make your hand.
When you select two cards to discard, you get either a green, yellow, or red background.
- Red: both the cards you selected were wrong
- Yellow: one of the cards you selected was wrong, and one was correct
- Green: both cards are correct. You win!
When activating the Python virtual environment, use the following command:
$ . venv/bin/activate
to setup the proper dependencies.
To deactivate the virtual environment, run
$ deactivate
To run the flask app, navigate to the app
directory. Then run:
$ flask run
Because app.py
is one of the default apps supported, this should work fine on
the first try.
I have finally settled on a solution for the gameplay. The mimimum game that I
will first build captures the discard phase. There are
After building this, I will construct two levels: easy (where you get feedback if one of your cards is correct), and hard (where you get no feedback at all). This is important, as this game is significantly different from Wordle in that you are selecting combinations, not permutations, and thus any information given away makes the game significantly easier.
After this, I will add a second game (or phase of the game, TBD) where you imagine that you are giving cards to your opponent's crib. You want to make a discard that again maximizes the expected value of your hand, but that also minimizes the value of your opponent's hand. I'm not sure how closely these will align, but it would be a cool feature to build.
- Flask quickstart, provides basic details on how to setup and use Flask
- flask-examples, a repository on GitHub with several examples of simple Flask apps; see also the parent resource helloflask
- flask-realworld-example-app,
the "official" example app using Flask by
gothinkster
, a production-grade example might look like this; could help with best practice and configuring the codebase - conduit-flask, another "real- world" application of Flask
- Probability & Cribbage, courtesy of the MEC
- Optimal Expected Values for Cribbage Hands, a thesis by Philip Martin from ~25 years ago attempting to answer the question: how advantageous is it to deal first in cribbage?
- Cribbage Classic, comes with a tool where you can analyze discards against the expected value of every possible hand
- Cribbage Discard Pro, another discard analyzer that goes more in-depth (suggested (my implementation) vs. hail mary vs. aggressive hands)
- Cribbage Evaluator, another discard analyzer with a more difficult interface on a PC machine