#ifndef JEFF_POSITION_H #define JEFF_POSITION_H #include #include "pie/dib24.h" /* Macro */ #define foreach_direction(dir) for(dir=DIR_UP; d<=DIR_RIGHT; d=d<<1) /* Types */ #define DIR_NONE 0 #define DIR_UP 1 #define DIR_DOWN 2 #define DIR_LEFT 4 #define DIR_RIGHT 8 typedef int direction_t; typedef struct pos { int x; int y; } position_t; /* Functions */ void print_dirs(direction_t dirs); direction_t dir_invert(direction_t dir); unsigned int move_safe(Dib24 *xi, unsigned int xy, direction_t dir, unsigned int distance); #endif /* JEFF_POSITION_H */