simon says
Simon Says game in JavaScript.
Demo
http://lab.moogs.io/simon-says
Install
npm install simonsays
Usage
const SimonSays = ; var game = ; var sequence = gamestart;console; // [SimonSays.GREEN] console; // 1 var userInput = SimonSaysGREEN;console; // true sequence = game;console; // [SimonSays.GREEN, SimonSays.BLUE] console; // 2 userInput = SimonSaysGREEN SimonSaysBLUE;console; // true sequence = game;console; // [SimonSays.GREEN, SimonSays.BLUE, SimonSays.BLUE] console; // 3 userInput = SimonSaysGREEN SimonSaysBLUE SimonSaysBLUE;console; // true sequence = game;console; // [SimonSays.GREEN, SimonSays.BLUE, SimonSays.BLUE, SimonSays.RED] console; // 4 userInput = SimonSaysGREEN SimonSaysBLUE SimonSaysBLUE SimonSaysRED;console; // true sequence = game;console; // [SimonSays.GREEN, SimonSays.BLUE, SimonSays.BLUE, SimonSays.RED, SimonSays.YELLOW] console; // 5 // Got it wrong!userInput = SimonSaysGREEN SimonSaysBLUE SimonSaysBLUE SimonSaysRED SimonSaysGREEN;console; // false console; // [SimonSays.GREEN, SimonSays.BLUE, SimonSays.BLUE, SimonSays.RED, SimonSays.YELLOW] // Restartsequence = game;console; // [SimonSays.GREEN] console; // 1 userInput = SimonSaysGREEN;console; // true
Use a predetermined sequence.
var game = sequence: SimonSaysGREEN SimonSaysBLUE SimonSaysBLUE SimonSaysRED SimonSaysYELLOW SimonSaysRED SimonSaysGREEN SimonSaysGREEN SimonSaysBLUE;
Test
npm test
License
MIT