Fixed a little silly

This commit is contained in:
AnnaSnoeijs 2025-06-25 11:41:51 +02:00
parent 22356ca529
commit e31258e26c
3 changed files with 5 additions and 4 deletions

View file

@ -72,7 +72,7 @@ void calcWins(
// Now the rest of the wins
// First connect 2
for(
columnsint_t i = top( column - 1, 0 );
columnsint_t i = clipped_subtract( column, 1 );
i < bottom( column + 1, board.columns - 1 );
i++
){
@ -101,7 +101,7 @@ void calcWins(
}
// Then stitch the twos together and count
for(
columnsint_t i = top( column - 3, 0 );
columnsint_t i = clipped_subtract( column, 3 );
i < bottom( column + 1, board.columns - 3 );
i++
){

View file

@ -6,11 +6,11 @@
extern void playMove(
board_t *boardptr,
const int column
const columnsint_t column
);
extern void calcWins(
wins_t *wins,
const board_t board,
const int column
const columnsint_t column
);

View file

@ -3,6 +3,7 @@
#define top( a, b ) ( a < b ? b : a )
#define bottom( a, b ) ( a < b ? a : b )
#define clipped_subtract( a, b ) ( a < b ? 0 : a - b )
#define XSTR(s) STR(s)
#define STR(s) #s