Fixed a typo

This commit is contained in:
AnnaSnoeijs 2025-06-06 21:31:59 +02:00
parent 1855c2e1cf
commit b05a803cd8
6 changed files with 42 additions and 42 deletions

24
logic.c
View file

@ -26,12 +26,12 @@ static inline int bottom( const int a, const int b ){
return a < b ? a : b;
}
static inline int heigthMask( const int a ){
static inline int heightMask( const int a ){
return ( 1 << a ) - 1;
}
static inline int safeHeigthMask( const int a ){
return a > 0 ? heigthMask( a ) : 0;
return a > 0 ? heightMask( a ) : 0;
}
static inline int bottomHeigthMask( const int a, const int b ){
@ -50,13 +50,13 @@ void playMove(
case PUT: // Put a new piece in the board
#endif /* ! ONLYPUT */
boardptr->column [ column ] |=
boardptr->player << boardptr->heigth [ column ];
boardptr->heigth [ column ]++;
boardptr->player << boardptr->height [ column ];
boardptr->height [ column ]++;
#ifndef ONLYPUT
break;
case POP: // Pop out the lowest and make all above fall down
boardptr->column [ column ] >>= 1;
boardptr->heigth [ column ]--;
boardptr->height [ column ]--;
}
#endif /* ! ONLYPUT */
}
@ -73,7 +73,7 @@ void calcWins(
wins->same.vertical2 [ i ] =
~( board.column [ i ]
^ board.column [ i ] >> 1 )
& safeHeigthMask( board.heigth [ i ] - 1 );
& safeHeigthMask( board.height [ i ] - 1 );
// Actually check for win
wins->same.vertical4 [ i ] =
wins->same.vertical2 [ i ]
@ -100,22 +100,22 @@ void calcWins(
~( board.column [ i ]
^ board.column [ i + 1 ] )
& bottomHeigthMask(
board.heigth [ i ],
board.heigth [ i + 1 ]
board.height [ i ],
board.height [ i + 1 ]
);
wins->same.diagonalUp2 [ i ] =
~( board.column [ i ]
^ board.column [ i + 1 ] >> 1 )
& bottomHeigthMask(
board.heigth [ i ],
board.heigth [ i + 1 ] - 1
board.height [ i ],
board.height [ i + 1 ] - 1
);
wins->same.diagonalDown2 [ i ] =
~( board.column [ i ]
^ board.column [ i + 1 ] << 1 )
& bottomHeigthMask(
board.heigth [ i ],
board.heigth [ i + 1 ] + 1
board.height [ i ],
board.height [ i + 1 ] + 1
)
& ~1; // A diagonal line down ain't starts at the floor innit?
}