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(
#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 */
}