|
|
@ -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; |
|
|
|