|
|
@ -14,11 +14,11 @@ struct usrCommand COMMANDS[MAX_COMMANDS] = { |
|
|
|
}; |
|
|
|
|
|
|
|
void startTicTacToe(){ |
|
|
|
setbuf(stdout, 0); |
|
|
|
setbuf(stdout, 0); // for debug output |
|
|
|
printf( "%s\n", getWelcomeMessageTicTacToe() ); |
|
|
|
printf( "%s\n\n", getRulesMessageTicTacToe() ); |
|
|
|
|
|
|
|
GAME = createTicTacToe(); |
|
|
|
GAME = createTicTacToe(); // create the "game object" |
|
|
|
|
|
|
|
while( GAME.currentState != -1 ){ |
|
|
|
commandFunction usrCommand; |
|
|
@ -26,7 +26,7 @@ void startTicTacToe(){ |
|
|
|
usrCommand = getCommandById( GAME.currentState + 1); |
|
|
|
|
|
|
|
if( usrCommand != NULL) |
|
|
|
usrCommand(0); |
|
|
|
usrCommand(0); // 0, for non test behavior |
|
|
|
else{ |
|
|
|
printf("command not found"); |
|
|
|
return; |
|
|
|