19 /* glenda faces the horizontal direction she's moving in */
29 SizeX = MazeX*BoardX+10,
30 SizeY = MazeY*BoardY+10,
36 uint dir; /* direction */
37 uint count; /* number of single-step moves */
40 typedef struct Route {
41 uint nstep; /* number of valid Step */
43 Point dest; /* result of step */
47 uint nroute; /* number of valid Route* */
49 uint beyond; /* number of allocated Route* */
52 typedef struct Visited {
53 uint board[MazeX][MazeY];
56 typedef struct Animation {
64 Point max; /* that's how much the board spans */
67 uint board[MazeX][MazeY];
70 Level level; /* the current level */
71 Level levels[Maxlevels]; /* all levels from this file */
72 int numlevels; /* how many levels do we have */
74 Image *img; /* buffer */
75 Image *text; /* for text messages */
89 void drawscreen(void);
92 void drawglenda(void);
93 void drawboard(Point);
95 Point boardsize(Point);
98 int loadlevels(char *);
104 int validpush(Point, Step*, Point*);
105 int isvalid(Point, Route*, int (*)(Point, Step*, Point*));
106 void freeroute(Route*);
107 Route* extend(Route*, int, int, Point);
108 Route* findroute(Point, Point);
111 void initanimation(Animation*);
112 void setupanimation(Animation*, Route*);
113 int onestep(Animation*);
114 void stopanimation(Animation*);
118 char *genlevels(int);
119 Image *eallocimage(Rectangle, int, uint);