Skip to content

mdox/mz-mastermind-vanilla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mz-mastermind-vanilla

A simplified MasterMind game written in Vanilla JavaScript.

Usage

  • Download the repository, redirect in your browser to the index.html absolute file path.
  • Or $ npx serve or any of such kind.
  • Or visit: https://mdox.github.io/mz-mastermind-vanilla/
  • Click on the bottom colors to choose colors for selected (or preselected) peg place.

Development

  • MVC like pattern (for simplicity)
  • Small Templating (to avoid reinventing a framework)
  • Mostly Functional Programming (faster to implement, maintain)
  • Slightly ES6 (it is modern days)
  • SCSS (using Live Sass Compiler)

Cheating

  • Enter game.state.code.values in DevTools Console. (prints the hidden code)
  • Enter game.playerSettings.shuffleScores = false in DevTools Console. (disable score randomizing)
  • Enter game.end(true) in DevTools Console. (win)
  • Enter game.end(false) in DevTools Console. (lose)