Awesome
solitaire.hs
╭───────────── Solitaire ──────────────╮
│╭──╮│╭──╮╭──╮╭──╮╭──╮╭──╮╭──╮╭──╮│╭ ╮│ Score: 0
││λ=││╭──╮╭──╮╭──╮╭──╮╭──╮╭──╮│7♠││ │
│╰──╯│╭──╮╭──╮╭──╮╭──╮╭──╮│K♥│╰──╯│╰ ╯│ Moves: 0
│╭──╮│╭──╮╭──╮╭──╮╭──╮│J♣│╰──╯ │╭ ╮│
││3♠││╭──╮╭──╮╭──╮│6♦│╰──╯ │ │ [New]
│╭──╮│╭──╮╭──╮│9♣│╰──╯ │╰ ╯│
││3♥││╭──╮│Q♠│╰──╯ │╭ ╮│ [Undo]
│╭──╮││4♠│╰──╯ │ │
││7♦││╰──╯ │╰ ╯│
│╰──╯│ │╭ ╮│
│ │ │ │
│ │ │╰ ╯│
│ │ │ │
╰──────────────────────────────────────╯
Essay
For more background on this project, read the blog post I wrote about developing it.
Prerequisites
You'll need to install:
- haskell, a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing.
- stack, a cross-platform program for developing Haskell projects.
Playing solitaire
You can clone this repo and use stack
to build and run the executable like so:
git clone https://github.com/ambuc/solitaire.git
cd solitaire
stack build
stack exec solitaire-exe
Links
- brick, a Haskell terminal user interface programming library.
- microlens, a small extract of
the larger
Control.Lens
library, which implements functional references.Control.Lens.Tutorial
, a great tutorial for understanding and using Haskell lenses or microlenses