An implementation of the brilliant game Love Letter, written in Haskell.
- Install Haskell Stack onto your system through the package manager or the Haskell Stack website.
- Grab the source code:
git clone https://github.com/dixonary/hove-letter
- Enter the directory:
cd hove-letter
- Build and run the code:
stack build && stack exec love-letter
- Make sure you have LibGMP installed, against which Haskell binaries are dynamically linked. Chances are good that you do.
- Download the binary from the Releases page here on GitHub.
- Run the binary directly:
./love-letter
There are 3 steps to writing good Haskell code:
- Make it work.
- Make it simple.
- Make it readable.
The code here is very much stage-one code. There aren't a million comments and the actual implementation is fairly crap. There's a lot of low-hanging fruit for refactoring and general niceness improvements!
The AI is also exceptionally stupid, in that it will always play its held card (unless that is an illegal move). Making the AI better is left to the reader.