All Projects → hdgarrood → solitaire

hdgarrood / solitaire

Licence: other
Basic Solitaire game in PureScript, with both web and terminal UIs

Programming Languages

purescript
368 projects
Dhall
116 projects
HTML
75241 projects

solitaire

A basic Solitaire game, written in PureScript, including both a console and a web UI.

Module overview

  • Solitaire.Prelude - a custom Prelude for this project.

Game logic

The following modules define basic data types for the game, and operations on them.

  • Solitaire.Card
  • Solitaire.Tableaux
  • Solitaire.Foundations
  • Solitaire.Stock
  • Solitaire.Stack
  • Solitaire.Deck
  • Solitaire.Game

Console UI

The console UI uses node.js's readline module for a repl-ish interface. For printing things, it uses ANSI escape codes and unicode line-drawing characters to make the output recognisable as a Solitaire game.

The console UI code is contained in the following modules:

  • Solitaire.Ansi (this module is also useful for debugging in the PureScript repl)
  • Solitaire.Repl

To play with the console UI, run

$ spago bundle-app --main Solitaire.Repl --to game.js && node game.js

Web UI

The web UI uses Halogen, and is contained in the following modules:

  • Solitaire.Web
  • Solitaire.Web.Positioning

To play with the web UI, run

$ spago bundle-app --main Solitaire.Web --to web/app.js

and then open web/index.html in a browser window.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].