mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-26 09:58:48 +01:00
comment hairy conditional + remove debug print
This commit is contained in:
parent
9b190a3bd5
commit
4fcfc251a1
1 changed files with 5 additions and 2 deletions
7
star.c
7
star.c
|
@ -116,10 +116,13 @@ void move( state *s, int direction )
|
|||
}
|
||||
|
||||
/* Calculating arrival coordinates */
|
||||
while (
|
||||
while ( /* Hairy conditions ahead */
|
||||
/* target cell is within level's boundaries */
|
||||
( ( tmpx + dx >= 0 ) && ( tmpx + dx < LEVEL_WIDTH ) ) &&
|
||||
( ( tmpy + dy >= 0 ) && ( tmpy + dy < LEVEL_HEIGHT ) ) &&
|
||||
/* and target cell is empty */
|
||||
( get_cell( s, tmpx + dx, tmpy + dy ) == VOID )
|
||||
/* or, in case the ball is moving, target cell can be a gift (which we'll eat) */
|
||||
|| ( s->moving == BALL && ( get_cell( s, tmpx + dx, tmpy + dy ) == GIFT ) )
|
||||
) {
|
||||
tmpx += dx;
|
||||
|
@ -182,7 +185,7 @@ int main( int argc, char* argv[] )
|
|||
load_level( s, levels[ 0 ] );
|
||||
|
||||
display_level( s );
|
||||
fprintf( stderr, "starting to move\n" );
|
||||
|
||||
char* moves = "drdluruldrdlrulurudlurdul";
|
||||
do {
|
||||
fprintf( stderr, "move %c\n", moves[ i ]);
|
||||
|
|
Loading…
Reference in a new issue