Fixed a typo

This commit is contained in:
AnnaSnoeijs 2025-06-06 21:31:59 +02:00
parent b05a803cd8
commit a4811efca5

14
logic.c
View file

@ -30,12 +30,12 @@ static inline int heightMask( const int a ){
return ( 1 << a ) - 1;
}
static inline int safeHeigthMask( const int a ){
static inline int safeHeightMask( const int a ){
return a > 0 ? heightMask( a ) : 0;
}
static inline int bottomHeigthMask( const int a, const int b ){
return safeHeigthMask( bottom( a, b ) );
static inline int bottomHeightMask( const int a, const int b ){
return safeHeightMask( bottom( a, b ) );
}
void playMove(
@ -73,7 +73,7 @@ void calcWins(
wins->same.vertical2 [ i ] =
~( board.column [ i ]
^ board.column [ i ] >> 1 )
& safeHeigthMask( board.height [ i ] - 1 );
& safeHeightMask( board.height [ i ] - 1 );
// Actually check for win
wins->same.vertical4 [ i ] =
wins->same.vertical2 [ i ]
@ -99,21 +99,21 @@ void calcWins(
wins->same.horizontal2 [ i ] =
~( board.column [ i ]
^ board.column [ i + 1 ] )
& bottomHeigthMask(
& bottomHeightMask(
board.height [ i ],
board.height [ i + 1 ]
);
wins->same.diagonalUp2 [ i ] =
~( board.column [ i ]
^ board.column [ i + 1 ] >> 1 )
& bottomHeigthMask(
& bottomHeightMask(
board.height [ i ],
board.height [ i + 1 ] - 1
);
wins->same.diagonalDown2 [ i ] =
~( board.column [ i ]
^ board.column [ i + 1 ] << 1 )
& bottomHeigthMask(
& bottomHeightMask(
board.height [ i ],
board.height [ i + 1 ] + 1
)