Skip to content

Trying out ReasonML/BuckleScript/OCaml with the mastermind game

Notifications You must be signed in to change notification settings

kberridge/bs-mastermind

Repository files navigation

bs-mastermind

Learning ReasonML/BuckleScript/OCaml with the mastermind game.

Mastermind is an old code-breaking board game. This implements the game loop rules, a super ugly UI, and the scoring algorithm.

The scoring rules are:

  1. Each peg in the guess which is the same color and in the same position as a peg in the secret is given a black marker
  2. Each peg in the guess which is the same color but not in the same position as a peg in the secret is given a white marker
  3. Black markers are placed before white markers
  4. Each peg can only result in one marker (no double matches), and if it is an exact match the exatch match marker must be given (not the white marker)

Run Project

npm install
npm start # builds bucklescript in watch mode

# in another tab
npm run webpack # builds JS bundle

# in yet another tab
npm run server # runs hot-reloading dev server

# open http://localhost:8000/ in a web browser
# play mastermind!

Run Tests

npm run test

The vscode jest extension also works.

About

Trying out ReasonML/BuckleScript/OCaml with the mastermind game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published