made code a bit less ugly

This commit is contained in:
AnnaSnoeijs 2025-06-06 21:31:59 +02:00
parent 7d0a0e1803
commit 2e807ba279

View file

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