diff --git a/src/main/c/Georg/tictactoe.c b/src/main/c/Georg/tictactoe.c index 614a3e7..4838534 100644 --- a/src/main/c/Georg/tictactoe.c +++ b/src/main/c/Georg/tictactoe.c @@ -100,7 +100,7 @@ int handleGameInput( char* input ){ if( strstr(input, "set") != NULL ){ return 1; }else{ - return false; + return -1; } } @@ -159,9 +159,12 @@ int startGame( int code ){ initializeBoard( board ); while( GAME.currentState == 1 ){ - int nextState = handleCommand( getUserInput() ); + char* input = getUserInput(); + int nextState = handleCommand( input ); + + if( nextState == -1 ){ // no stateCommand + int gameCommand = handleGameInput( input ); - if( nextState == -1 ){ printf("command not found!"); }else{ GAME.currentState = nextState;