#include "Simon.h" extern "C" { #include } Simon::Simon() { Initialize();//Note be sure you seeded rand } void Simon::Initialize() { m_nCurrentLength =1; m_nLocation = 0; m_eGameStatus = GameInProgress; for(int i=0; i= m_nCurrentLength ) { m_nCurrentLength++; if( m_nCurrentLength > MAX_SEQUENCE_LENGTH ) { m_eGameStatus = YouWon; } return false; } return true; } m_eGameStatus = YouPressedWrongButton; return false; } bool Simon::IsGameOver() const { return m_eGameStatus != GameInProgress; } bool Simon::DidWrongButton() const { return m_eGameStatus == YouPressedWrongButton; } bool Simon::DidTakeTooLong() const { return m_eGameStatus == YouTookTooLong; } bool Simon::DidWin() const { return m_eGameStatus == YouWon; }