diff --git a/connect4.c b/connect4.c index c202d00..22c90fc 100644 --- a/connect4.c +++ b/connect4.c @@ -212,11 +212,9 @@ static void playMove( } static int askColumn( -#ifndef ONLYPUT - const board_t board, - const move_t move -#else /* ONLYPUT */ const board_t board +#ifndef ONLYPUT + ,const move_t move #endif /* ONLYPUT */ ){ int column; @@ -261,8 +259,8 @@ static move_t askMove( void ){ // TODO: actually ask what move return move; } - #endif /* ! ONLYPUT */ + static void calcWins( wins_t *wins, const board_t board @@ -407,14 +405,12 @@ int main(){ move = askMove(); column = askColumn( playboard, move ); playMove( &playboard, move, column ); + calcWins( &wins, playboard ); + updateBoard( wins, playboard, move, column ); #else /* ONLYPUT */ column = askColumn( playboard ); playMove( &playboard, column ); -#endif /* ONLYPUT */ calcWins( &wins, playboard ); -#ifndef ONLYPUT - updateBoard( wins, playboard, move, column ); -#else /* ONLYPUT */ updateBoard( wins, playboard, column ); #endif /* ONLYPUT */ }