mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Correct RANGECHECK macro in Black Box
Lasers are numbered from 0 to nlasers-1 inclusive, so the upper limit should be "<", not "<=".
This commit is contained in:
@ -305,7 +305,7 @@ struct game_state {
|
||||
|
||||
#define GRID(s,x,y) ((s)->grid[(y)*((s)->w+2) + (x)])
|
||||
|
||||
#define RANGECHECK(s,x) ((x) >= 0 && (x) <= (s)->nlasers)
|
||||
#define RANGECHECK(s,x) ((x) >= 0 && (x) < (s)->nlasers)
|
||||
|
||||
/* specify numbers because they must match array indexes. */
|
||||
enum { DIR_UP = 0, DIR_RIGHT = 1, DIR_DOWN = 2, DIR_LEFT = 3 };
|
||||
|
Reference in New Issue
Block a user