Added HangmanGame class, but does not work yet
Dependencies: SDFileSystem app epson mbed msp430 pl tests
hangman.h
- Committer:
- markpsymonds
- Date:
- 2017-12-04
- Revision:
- 1:a5ec6f9dcf0d
- Parent:
- 0:fa7450a43b99
File content as of revision 1:a5ec6f9dcf0d:
// // Filename: hangman.h // // Class for the hangman game played on pagesensor and pageflexenable. // // include guards #include <memory> #include "mbed.h" #include "log.h" //include more files, e.g. where eink display is changed, and to read from SD card namespace Flexbook { class HangmanGame { public: // Constructor needs to be explicit. explicit HangmanGame(); // Destructor ~HangmanGame(); // Game status indicator bool finished; private: // Word to be guessed, word guessed so far char word[14]; char guessed[14]; // Number of letters in word to be guessed char wordlength; // Currently selected and previous position on the alphabet matrix char currentpos; char oldpos; // Status indicator for each letter on the alphabet matrix, already used or not? bool alphabet[27]; // Number of wrong guesses, equals number of elements of hanging man drawn char hangstage; // Routine to determine how to move the cursor after electrode touch char movecursor(char oldpos, char buttonnumber); // Routine to run after confirming selection of a position in the alphabet matrix void select(); // Routine to redraw the alphabet matrix after a cursor move void RedrawAlphabet(char newpos, char oldpos); }; }