FlexBook / Mbed 2 deprecated FlexBook171204a

Dependencies:   SDFileSystem app epson mbed msp430 pl tests

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hangman.cpp Source File

hangman.cpp

00001 
00002 
00003 #include "log.h"
00004 
00005 #include "hangman.h"
00006 
00007 namespace Flexbook
00008 {
00009 
00010 HangmanGame::HangmanGame()
00011 : finished(false), word(""), guessed(""),
00012   wordlength(0), currentpos(), oldpos(),
00013   alphabet(), hangstage()
00014 {
00015     Log("Creating hangman game");
00016     // Display the game welcome screen
00017     for (int i=0; i<27; i++)
00018     {
00019         alphabet[i]=false;
00020         }
00021     currentpos=13;
00022     oldpos=13;
00023     hangstage=0;
00024     wordlength = ReturnWord(*word);
00025     for (int i=0; i<wordlength; i++)
00026     {
00027         guessed[i]=13;
00028         }
00029     // Display the game start screen
00030 }
00031 
00032 void HangmanGame::RedrawAlphabet(char newpos, char oldpos)
00033 {
00034         // redraw the alphabet matrix based on a cursor move
00035 }
00036 
00037 }