|
@ -100,7 +100,7 @@ int handleGameInput( char* input ){ |
|
|
if( strstr(input, "set") != NULL ){ |
|
|
if( strstr(input, "set") != NULL ){ |
|
|
return 1; |
|
|
return 1; |
|
|
}else{ |
|
|
}else{ |
|
|
return false; |
|
|
|
|
|
|
|
|
return -1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -159,9 +159,12 @@ int startGame( int code ){ |
|
|
initializeBoard( board ); |
|
|
initializeBoard( board ); |
|
|
|
|
|
|
|
|
while( GAME.currentState == 1 ){ |
|
|
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!"); |
|
|
printf("command not found!"); |
|
|
}else{ |
|
|
}else{ |
|
|
GAME.currentState = nextState; |
|
|
GAME.currentState = nextState; |
|
|