Rewrote game logic with a finite state machine!
Fixed bug where same letter could be guessed multiple times (introduced by previous commit
Refactored state machine logic
Gave each action its own method to simplify state machine specification
Separated entry and transition actions
Created a top-level ‘enum’ for state machine event types
Moved accessors within Game
Moved things around within Game
Made Game, Score, and Controller top-level functions
Refactored private functions as instance methods, with correct ‘this’ argument set within StateMachine
Made Score self-initializing
Refactored transitionToState in StateMachine
Refactored private variables as instance variables in Game
Made scores an instance variable of Score
Added a couple of comments regarding FSM
Minor refactoring of StateMachine.raiseEvent()
Added radix to calls to parseInt
Moved function call to reset alphabet from Game to Controller
Corrected typo
Refactored initialization of StateMachine (and removed unnecessary variables