Removed all move_t stuff because it was not implemented and anything other than putting got broken in the previous commit
This commit is contained in:
parent
8810175693
commit
355c79bac4
7 changed files with 39 additions and 156 deletions
19
logic.c
19
logic.c
|
|
@ -38,25 +38,16 @@ static inline int bottomHeightMask( const int a, const int b ){
|
|||
return safeHeightMask( bottom( a, b ) );
|
||||
}
|
||||
|
||||
void playMove(
|
||||
inline void playMove(
|
||||
board_t *boardptr,
|
||||
const move_t move,
|
||||
const int column
|
||||
){
|
||||
switch( move ){
|
||||
case PUT: // Put a new piece in the board
|
||||
boardptr->column [ column ] |=
|
||||
boardptr->player << boardptr->height [ column ];
|
||||
boardptr->height [ column ]++;
|
||||
break;
|
||||
case POP: // Pop out the lowest and make all above fall down
|
||||
boardptr->column [ column ] >>= 1;
|
||||
boardptr->height [ column ]--;
|
||||
default: // Do nothing
|
||||
}
|
||||
boardptr->column [ column ] |=
|
||||
boardptr->player << boardptr->height [ column ];
|
||||
boardptr->height [ column ]++;
|
||||
}
|
||||
|
||||
void calcWins(
|
||||
inline void calcWins(
|
||||
wins_t *wins,
|
||||
const board_t board,
|
||||
const int column
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue