Browse Source

using unsigned UNUM_ROWS and UNUM_COLS saves 80 bytes without breaking it

feature/2015
Christian Kroll 14 years ago
parent
commit
a453b61742
  1. 8
      animations/gameoflife.c

8
animations/gameoflife.c

@ -20,16 +20,16 @@
#undef DEBUG
#define XSIZE NUM_COLS
#define YSIZE NUM_ROWS
#define XSIZE UNUM_COLS
#define YSIZE UNUM_ROWS
/*
* last line is for debug information
*/
#ifdef DEBUG
#undef YSIZE
#define YSIZE (NUM_ROWS-1)
#define DEBUG_ROW (NUM_ROWS-1)
#define YSIZE (UNUM_ROWS-1)
#define DEBUG_ROW (UNUM_ROWS-1)
#define DEBUG_BIT(pos, val) \
setpixel((pixel){(pos)%XSIZE,DEBUG_ROW+(pos)/XSIZE},(val)?3:0)
#define DEBUG_BYTE(s,v) \

Loading…
Cancel
Save