Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

dice game instructions + analysis + monte carlo simulation

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Guardfile
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
Octocat-spinner-32 analysis.pdf
Octocat-spinner-32 analysis.tex
Octocat-spinner-32 pig.hs
README.md

pig - dice game instructions + analysis + monte carlo simulation

HOMEPAGE

Wikipedia: Pig

CONTENTS

  • analysis.pdf - Statistical analysis
  • pig.hs - Monte Carlo simulation in Haskell

EXAMPLE

$ git clone https://github.com/mcandre/pig.git
$ cd pig
$ cabal install random-fu
$ make
./pig
Running 10000 games...
Totaling wins...

Roll Six       32%
Roll Five      28%
Roll K Times   27%
100 or Bust    8%
Roll Bad K     3%
Always Hold    0%
Always Roll    0%
Roll Once      0%

REQUIREMENTS

Optional

Install Guard and aspelllint:

$ bundle

DEVELOPMENT

Lint

Keep the code tidy with HLint:

$ cabal install hlint
$ make lint

Spell Check

$ aspelllint
...

Local CI

Start Guard in a shell, and it will automatically run unit tests when the source code changes:

$ guard
...
Something went wrong with that request. Please try again.