ReactOS  0.4.13-dev-563-g0561610
maze.c File Reference
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <windows.h>
Include dependency graph for maze.c:

Go to the source code of this file.

Macros

#define STRICT
 
#define APIENTRY   far pascal
 
#define DLGPROC   FARPROC
 
#define MAX_MAZE_SIZE_X   ((unsigned long) 250)
 
#define MAX_MAZE_SIZE_Y   ((unsigned long) 250)
 
#define MOVE_LIST_SIZE   (MAX_MAZE_SIZE_X * MAX_MAZE_SIZE_Y)
 
#define WALL_TOP   0x8000
 
#define WALL_RIGHT   0x4000
 
#define WALL_BOTTOM   0x2000
 
#define WALL_LEFT   0x1000
 
#define DOOR_IN_TOP   0x800
 
#define DOOR_IN_RIGHT   0x400
 
#define DOOR_IN_BOTTOM   0x200
 
#define DOOR_IN_LEFT   0x100
 
#define DOOR_IN_ANY   0xF00
 
#define DOOR_OUT_TOP   0x80
 
#define DOOR_OUT_RIGHT   0x40
 
#define DOOR_OUT_BOTTOM   0x20
 
#define DOOR_OUT_LEFT   0x10
 
#define START_SQUARE   0x2
 
#define END_SQUARE   0x1
 
#define border_x   (0)
 
#define border_y   (0)
 
#define get_random(x)   (rand() % (x))
 

Functions

static BOOL InitApplication (HINSTANCE hInstance)
 
static BOOL InitInstance (HINSTANCE hInstance, int nCmdShow)
 
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM uParam, LPARAM lParam)
 
static void set_maze_sizes (int width, int height)
 
static void initialize_maze ()
 
static int choose_door ()
 
static long backup ()
 
static void draw_wall ()
 
static void draw_solid_square (int, int, int, HDC, HBRUSH)
 
static void enter_square (int, HDC, HBRUSH)
 
static void create_maze ()
 
static int choose_door (HDC hDC)
 
static void draw_maze_border (HWND hWnd, HDC hDC)
 
static void draw_wall (int i, int j, int dir, HDC hDC)
 
static void begin_solve_maze ()
 
static int solve_maze ()
 
static void start_timer (HWND hWnd, int iTimeout)
 
int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 
static BOOL OnCreate (HWND hWnd, LPCREATESTRUCT lpCreateStruct)
 
void OnTimer (HWND hwnd, UINT id)
 

Variables

HINSTANCE hInst
 
HWND hWnd
 
HBRUSH hBrushDead
 
HBRUSH hBrushLiving
 
HDC hDC
 
static BOOL waiting
 
char szAppName [] = "Maze"
 
char szTitle [] = "Maze"
 
static int solve_delay
 
static int pre_solve_delay
 
static int post_solve_delay
 
static unsigned short maze [MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y]
 
struct {
   unsigned char   x
 
   unsigned char   y
 
   unsigned char   dir
 
   unsigned char   dummy
 
move_list [MOVE_LIST_SIZE]
 
struct {
   unsigned char   x
 
   unsigned char   y
 
   unsigned char   dir
 
   unsigned char   dummy
 
save_path [MOVE_LIST_SIZE]
 
struct {
   unsigned char   x
 
   unsigned char   y
 
   unsigned char   dir
 
   unsigned char   dummy
 
path [MOVE_LIST_SIZE]
 
static int maze_size_x
 
static int maze_size_y
 
static long sqnum
 
static long path_length
 
static int cur_sq_x
 
static int cur_sq_y
 
static int start_x
 
static int start_y
 
static int start_dir
 
static int end_x
 
static int end_y
 
static int end_dir
 
static int grid_width
 
static int grid_height
 
static int state = 1
 
static int pathi = 0
 
int bw
 

Macro Definition Documentation

◆ APIENTRY

#define APIENTRY   far pascal

Definition at line 58 of file maze.c.

◆ border_x

#define border_x   (0)

Definition at line 107 of file maze.c.

◆ border_y

#define border_y   (0)

Definition at line 108 of file maze.c.

◆ DLGPROC

#define DLGPROC   FARPROC

Definition at line 62 of file maze.c.

◆ DOOR_IN_ANY

#define DOOR_IN_ANY   0xF00

Definition at line 97 of file maze.c.

◆ DOOR_IN_BOTTOM

#define DOOR_IN_BOTTOM   0x200

Definition at line 95 of file maze.c.

◆ DOOR_IN_LEFT

#define DOOR_IN_LEFT   0x100

Definition at line 96 of file maze.c.

◆ DOOR_IN_RIGHT

#define DOOR_IN_RIGHT   0x400

Definition at line 94 of file maze.c.

◆ DOOR_IN_TOP

#define DOOR_IN_TOP   0x800

Definition at line 93 of file maze.c.

◆ DOOR_OUT_BOTTOM

#define DOOR_OUT_BOTTOM   0x20

Definition at line 101 of file maze.c.

◆ DOOR_OUT_LEFT

#define DOOR_OUT_LEFT   0x10

Definition at line 102 of file maze.c.

◆ DOOR_OUT_RIGHT

#define DOOR_OUT_RIGHT   0x40

Definition at line 100 of file maze.c.

◆ DOOR_OUT_TOP

#define DOOR_OUT_TOP   0x80

Definition at line 99 of file maze.c.

◆ END_SQUARE

#define END_SQUARE   0x1

Definition at line 105 of file maze.c.

◆ get_random

#define get_random (   x)    (rand() % (x))

Definition at line 110 of file maze.c.

◆ MAX_MAZE_SIZE_X

#define MAX_MAZE_SIZE_X   ((unsigned long) 250)

Definition at line 83 of file maze.c.

◆ MAX_MAZE_SIZE_Y

#define MAX_MAZE_SIZE_Y   ((unsigned long) 250)

Definition at line 84 of file maze.c.

◆ MOVE_LIST_SIZE

#define MOVE_LIST_SIZE   (MAX_MAZE_SIZE_X * MAX_MAZE_SIZE_Y)

Definition at line 86 of file maze.c.

◆ START_SQUARE

#define START_SQUARE   0x2

Definition at line 104 of file maze.c.

◆ STRICT

#define STRICT

Definition at line 50 of file maze.c.

◆ WALL_BOTTOM

#define WALL_BOTTOM   0x2000

Definition at line 90 of file maze.c.

◆ WALL_LEFT

#define WALL_LEFT   0x1000

Definition at line 91 of file maze.c.

◆ WALL_RIGHT

#define WALL_RIGHT   0x4000

Definition at line 89 of file maze.c.

◆ WALL_TOP

#define WALL_TOP   0x8000

Definition at line 88 of file maze.c.

Function Documentation

◆ backup()

static long backup ( )
static

Definition at line 367 of file maze.c.

368 {
369  sqnum--;
370  if (0 <= sqnum) {
371  cur_sq_x = move_list[sqnum].x;
372  cur_sq_y = move_list[sqnum].y;
373  }
374  return ( sqnum );
375 }
static struct @1536 move_list[MOVE_LIST_SIZE]
static long sqnum
Definition: maze.c:122
static int cur_sq_x
Definition: maze.c:123
static int cur_sq_y
Definition: maze.c:123

Referenced by create_maze().

◆ begin_solve_maze()

static void begin_solve_maze ( )
static

Definition at line 487 of file maze.c.

488 {
489  static long grayPattern[] = {
490  0x55555555,
491  0xaaaaaaaa,
492  0x55555555,
493  0xaaaaaaaa,
494  0x55555555,
495  0xaaaaaaaa,
496  0x55555555,
497  0xaaaaaaaa
498  };
499  static RGBQUAD argbq[] = {
500  { 0, 0, 255, 0 },
501  { 255, 255, 255, 0 }
502  };
503  BITMAPINFO *pbmi;
504 
505  hDC = GetDC(hWnd);
506  pbmi = malloc(sizeof(BITMAPINFOHEADER) + sizeof(argbq) + sizeof(grayPattern));
508  pbmi->bmiHeader.biWidth = 8;
509  pbmi->bmiHeader.biHeight = 8;
510  pbmi->bmiHeader.biPlanes = 1;
513  (void) memcpy(pbmi->bmiColors, argbq, sizeof(argbq));
514  (void) memcpy(pbmi->bmiColors + 2, grayPattern, sizeof(grayPattern));
515 #if 0
516  /* FIXME Pattern brushes not yet implemented in ReactOS */
518 #else
519  hBrushDead = CreateSolidBrush(RGB(255, 0, 0));
520 #endif
521 // hBrushDead = CreateHatchBrush(HS_DIAGCROSS, RGB(255, 0, 0));
522  free(pbmi);
523  hBrushLiving = CreateSolidBrush(RGB(0, 255, 0));
524 
525  /* plug up the surrounding wall */
527  maze[end_x][end_y] |= (WALL_TOP >> end_dir);
528 
529  /* initialize search path */
530  pathi = 0;
531  path[pathi].x = end_x;
532  path[pathi].y = end_y;
533  path[pathi].dir = -1;
534 }
static int start_y
Definition: maze.c:124
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1454
HDC hDC
Definition: maze.c:74
HDC WINAPI GetDC(_In_opt_ HWND)
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
Definition: ntgdi.h:2780
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define free
Definition: debug_ros.c:5
static int start_dir
Definition: maze.c:124
static int end_y
Definition: maze.c:124
DWORD biCompression
Definition: amvideo.idl:35
RGBQUAD bmiColors[1]
Definition: wingdi.h:1455
#define RGB(r, g, b)
Definition: wingdi.h:2918
HWND hWnd
Definition: maze.c:71
static int pathi
Definition: maze.c:127
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static int start_x
Definition: maze.c:124
static unsigned short maze[MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y]
Definition: maze.c:112
#define WALL_TOP
Definition: maze.c:88
Definition: services.c:325
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HBRUSH hBrushLiving
Definition: maze.c:72
static int end_x
Definition: maze.c:124
static int end_dir
Definition: maze.c:124
HBRUSH hBrushDead
Definition: maze.c:71
#define malloc
Definition: debug_ros.c:4
#define DIB_RGB_COLORS
Definition: wingdi.h:366
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
#define BI_RGB
Definition: precomp.h:34

Referenced by WinMain().

◆ choose_door() [1/2]

static int choose_door ( )
static

Referenced by create_maze().

◆ choose_door() [2/2]

static int choose_door ( HDC  hDC)
static

Definition at line 286 of file maze.c.

287 {
288  int candidates[3];
289  register int num_candidates;
290 
291  num_candidates = 0;
292 
293  /* top wall */
294  if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_TOP )
295  goto rightwall;
297  goto rightwall;
298  if ( maze[cur_sq_x][cur_sq_y] & WALL_TOP )
299  goto rightwall;
300  if ( maze[cur_sq_x][cur_sq_y - 1] & DOOR_IN_ANY ) {
304  goto rightwall;
305  }
306  candidates[num_candidates++] = 0;
307 
308  rightwall:
309  /* right wall */
311  goto bottomwall;
313  goto bottomwall;
314  if ( maze[cur_sq_x][cur_sq_y] & WALL_RIGHT )
315  goto bottomwall;
316  if ( maze[cur_sq_x + 1][cur_sq_y] & DOOR_IN_ANY ) {
318  maze[cur_sq_x + 1][cur_sq_y] |= WALL_LEFT;
320  goto bottomwall;
321  }
322  candidates[num_candidates++] = 1;
323 
324  bottomwall:
325  /* bottom wall */
327  goto leftwall;
329  goto leftwall;
330  if ( maze[cur_sq_x][cur_sq_y] & WALL_BOTTOM )
331  goto leftwall;
332  if ( maze[cur_sq_x][cur_sq_y + 1] & DOOR_IN_ANY ) {
334  maze[cur_sq_x][cur_sq_y + 1] |= WALL_TOP;
336  goto leftwall;
337  }
338  candidates[num_candidates++] = 2;
339 
340  leftwall:
341  /* left wall */
343  goto donewall;
345  goto donewall;
346  if ( maze[cur_sq_x][cur_sq_y] & WALL_LEFT )
347  goto donewall;
348  if ( maze[cur_sq_x - 1][cur_sq_y] & DOOR_IN_ANY ) {
350  maze[cur_sq_x - 1][cur_sq_y] |= WALL_RIGHT;
352  goto donewall;
353  }
354  candidates[num_candidates++] = 3;
355 
356  donewall:
357  if (num_candidates == 0)
358  return ( -1 );
359  if (num_candidates == 1)
360  return ( candidates[0] );
361  return ( candidates[ get_random(num_candidates) ] );
362 
363 }
static void draw_wall()
HDC hDC
Definition: maze.c:74
#define get_random(x)
Definition: maze.c:110
#define DOOR_IN_RIGHT
Definition: maze.c:94
#define DOOR_IN_BOTTOM
Definition: maze.c:95
#define WALL_RIGHT
Definition: maze.c:89
#define DOOR_IN_TOP
Definition: maze.c:93
#define DOOR_IN_ANY
Definition: maze.c:97
#define WALL_BOTTOM
Definition: maze.c:90
#define DOOR_IN_LEFT
Definition: maze.c:96
static unsigned short maze[MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y]
Definition: maze.c:112
#define WALL_TOP
Definition: maze.c:88
#define DOOR_OUT_BOTTOM
Definition: maze.c:101
#define DOOR_OUT_RIGHT
Definition: maze.c:100
#define DOOR_OUT_LEFT
Definition: maze.c:102
#define WALL_LEFT
Definition: maze.c:91
static int cur_sq_x
Definition: maze.c:123
static int cur_sq_y
Definition: maze.c:123
#define DOOR_OUT_TOP
Definition: maze.c:99

◆ create_maze()

static void create_maze ( )
static

Definition at line 235 of file maze.c.

236 {
237  register int i, newdoor = 0;
238  HDC hDC;
239 
240  hDC = GetDC(hWnd);
241  do {
242  move_list[sqnum].x = cur_sq_x;
243  move_list[sqnum].y = cur_sq_y;
244  move_list[sqnum].dir = newdoor;
245  while ( ( newdoor = choose_door(hDC) ) == -1 ) { /* pick a door */
246  if ( backup() == -1 ) { /* no more doors ... backup */
247  ReleaseDC(hWnd, hDC);
248  return; /* done ... return */
249  }
250  }
251 
252  /* mark the out door */
253  maze[cur_sq_x][cur_sq_y] |= ( DOOR_OUT_TOP >> newdoor );
254 
255  switch (newdoor) {
256  case 0: cur_sq_y--;
257  break;
258  case 1: cur_sq_x++;
259  break;
260  case 2: cur_sq_y++;
261  break;
262  case 3: cur_sq_x--;
263  break;
264  }
265  sqnum++;
266 
267  /* mark the in door */
268  maze[cur_sq_x][cur_sq_y] |= ( DOOR_IN_TOP >> ((newdoor+2)%4) );
269 
270  /* if end square set path length and save path */
271  if ( maze[cur_sq_x][cur_sq_y] & END_SQUARE ) {
272  path_length = sqnum;
273  for ( i=0; i<path_length; i++) {
274  save_path[i].x = move_list[i].x;
275  save_path[i].y = move_list[i].y;
276  save_path[i].dir = move_list[i].dir;
277  }
278  }
279 
280  } while (1);
281 
282 }
static long backup()
Definition: maze.c:367
HDC hDC
Definition: maze.c:74
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
static int choose_door()
static struct @1536 move_list[MOVE_LIST_SIZE]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define DOOR_IN_TOP
Definition: maze.c:93
HWND hWnd
Definition: maze.c:71
static long sqnum
Definition: maze.c:122
static unsigned short maze[MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y]
Definition: maze.c:112
static struct @1536 save_path[MOVE_LIST_SIZE]
static long path_length
Definition: maze.c:122
#define END_SQUARE
Definition: maze.c:105
static int cur_sq_x
Definition: maze.c:123
static int cur_sq_y
Definition: maze.c:123
#define DOOR_OUT_TOP
Definition: maze.c:99

Referenced by WinMain().

◆ draw_maze_border()

static void draw_maze_border ( HWND  hWnd,
HDC  hDC 
)
static

Definition at line 417 of file maze.c.

418 {
419  register int i, j;
420  HBRUSH hBrush;
421 
422 
423  for ( i=0; i<maze_size_x; i++) {
424  if ( maze[i][0] & WALL_TOP ) {
426  (void) LineTo(hDC, border_x + grid_width * (i + 1) - 1, border_y);
427  }
428  if ((maze[i][maze_size_y - 1] & WALL_BOTTOM)) {
430  border_y + grid_height * (maze_size_y) - 1, NULL);
431  (void) LineTo(hDC, border_x + grid_width * (i+1) - 1,
432  border_y + grid_height * (maze_size_y) - 1);
433  }
434  }
435  for ( j=0; j<maze_size_y; j++) {
436  if ( maze[maze_size_x - 1][j] & WALL_RIGHT ) {
438  border_y + grid_height * j, NULL);
440  border_y + grid_height * (j+1) - 1);
441  }
442  if ( maze[0][j] & WALL_LEFT ) {
444  (void) LineTo(hDC, border_x, border_y + grid_height * (j+1) - 1);
445  }
446  }
447 
448  hBrush = GetStockObject(BLACK_BRUSH);
450  draw_solid_square (end_x, end_y, end_dir, hDC, hBrush);
451 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static int start_y
Definition: maze.c:124
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
HDC hDC
Definition: maze.c:74
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
static int grid_height
Definition: maze.c:125
#define WALL_RIGHT
Definition: maze.c:89
static int start_dir
Definition: maze.c:124
static void draw_solid_square(int, int, int, HDC, HBRUSH)
Definition: maze.c:380
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define border_x
Definition: maze.c:107
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int end_y
Definition: maze.c:124
static int maze_size_x
Definition: maze.c:121
smooth NULL
Definition: ftsmooth.c:416
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define BLACK_BRUSH
Definition: wingdi.h:895
#define WALL_BOTTOM
Definition: maze.c:90
static int start_x
Definition: maze.c:124
static unsigned short maze[MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y]
Definition: maze.c:112
#define border_y
Definition: maze.c:108
#define WALL_TOP
Definition: maze.c:88
static int grid_width
Definition: maze.c:125
static int maze_size_y
Definition: maze.c:121
static int end_x
Definition: maze.c:124
static int end_dir
Definition: maze.c:124
#define WALL_LEFT
Definition: maze.c:91

Referenced by WinMain().

◆ draw_solid_square()

static void draw_solid_square ( int  i,
int  j,
int  dir,
HDC  hDC,
HBRUSH  hBrush 
)
static

Definition at line 380 of file maze.c.

384 {
385  RECT rc;
386 
387  switch (dir) {
388  case 0:
389  rc.left = border_x + bw + grid_width * i;
390  rc.right = rc.left + grid_width - (bw + bw);
391  rc.top = border_y - bw + grid_height * j;
392  rc.bottom = rc.top + grid_height;
393  break;
394  case 1:
395  rc.left = border_x + bw + grid_width * i;
396  rc.right = rc.left + grid_width;
397  rc.top = border_y + bw + grid_height * j;
398  rc.bottom = rc.top + grid_height - (bw + bw);
399  break;
400  case 2:
401  rc.left = border_x + bw + grid_width * i;
402  rc.right = rc.left + grid_width - (bw + bw);
403  rc.top = border_y + bw + grid_height * j;
404  rc.bottom = rc.top + grid_height;
405  break;
406  case 3:
407  rc.left = border_x - bw + grid_width * i;
408  rc.right = rc.left + grid_width;
409  rc.top = border_y + bw + grid_height * j;
410  rc.bottom = rc.top + grid_height - (bw + bw);
411  break;
412  }
413  (void) FillRect(hDC, &rc, hBrush);
414 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
HDC hDC
Definition: maze.c:74
LONG top
Definition: windef.h:292
static int grid_height
Definition: maze.c:125
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define border_x
Definition: maze.c:107
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int dir
Definition: maze.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
int bw
Definition: maze.c:377
#define border_y
Definition: maze.c:108
static int grid_width
Definition: maze.c:125
LONG bottom
Definition: windef.h:294
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)

Referenced by draw_maze_border(), enter_square(), and solve_maze().

◆ draw_wall() [1/2]

static void draw_wall ( )
static

Referenced by choose_door().

◆ draw_wall() [2/2]

static void draw_wall ( int  i,
int  j,
int  dir,
HDC  hDC 
)
static

Definition at line 455 of file maze.c.

458 {
459  switch (dir) {
460  case 0:
462  (void) LineTo(hDC, border_x + grid_width * (i+1),
463  border_y + grid_height * j);
464  break;
465  case 1:
467  NULL);
468  (void) LineTo(hDC, border_x + grid_width * (i+1),
469  border_y + grid_height * (j+1));
470  break;
471  case 2:
473  NULL);
474  (void) LineTo(hDC, border_x + grid_width * (i+1),
475  border_y + grid_height * (j+1));
476  break;
477  case 3:
479  NULL);
481  border_y + grid_height * (j+1));
482  break;
483  }
484 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
HDC hDC
Definition: maze.c:74
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
static int grid_height
Definition: maze.c:125
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define border_x
Definition: maze.c:107
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define border_y
Definition: maze.c:108
static int grid_width
Definition: maze.c:125

◆ enter_square()

static void enter_square ( int  n,
HDC  hDC,
HBRUSH  hBrush 
)
static

Definition at line 574 of file maze.c.

575 {
576  draw_solid_square( (int)path[n].x, (int)path[n].y,
577  (int)path[n].dir, hDC, hBrush);
578 
579  path[n+1].dir = -1;
580  switch (path[n].dir) {
581  case 0: path[n+1].x = path[n].x;
582  path[n+1].y = path[n].y - 1;
583  break;
584  case 1: path[n+1].x = path[n].x + 1;
585  path[n+1].y = path[n].y;
586  break;
587  case 2: path[n+1].x = path[n].x;
588  path[n+1].y = path[n].y + 1;
589  break;
590  case 3: path[n+1].x = path[n].x - 1;
591  path[n+1].y = path[n].y;
592  break;
593  }
594 }
HDC hDC
Definition: maze.c:74
GLdouble n
Definition: glext.h:7729
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static void draw_solid_square(int, int, int, HDC, HBRUSH)
Definition: maze.c:380
unsigned int dir
Definition: maze.c:112
Definition: services.c:325
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by solve_maze().

◆ InitApplication()

static BOOL InitApplication ( HINSTANCE  hInstance)
static

Definition at line 750 of file maze.c.

751 {
752  WNDCLASS wc;
753 
754  // Fill in window class structure with parameters that describe the
755  // main window.
756 
757  wc.style = CS_HREDRAW | CS_VREDRAW;// Class style(s).
758  wc.lpfnWndProc = (WNDPROC)WndProc; // Window Procedure
759  wc.cbClsExtra = 0; // No per-class extra data.
760  wc.cbWndExtra = 0; // No per-window extra data.
761  wc.hInstance = hInstance; // Owner of this class
762  wc.hIcon = LoadIcon (hInstance, szAppName); // Icon name from .RC
763  wc.hCursor = LoadCursor(NULL, (LPCTSTR) IDC_ARROW);// Cursor
764  wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);// Default color
765  wc.lpszMenuName = NULL; // No menu
766  wc.lpszClassName = szAppName; // Name to register as
767 
768  // Register the window class and return success/failure code.
769  return (RegisterClass(&wc));
770 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
int cbClsExtra
Definition: winuser.h:3118
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3124
HBRUSH hbrBackground
Definition: winuser.h:3123
#define COLOR_WINDOW
Definition: winuser.h:908
int cbWndExtra
Definition: winuser.h:3119
HINSTANCE hInstance
Definition: charmap.c:20
HCURSOR hCursor
Definition: winuser.h:3122
smooth NULL
Definition: ftsmooth.c:416
#define CS_VREDRAW
Definition: winuser.h:653
LPCSTR lpszClassName
Definition: winuser.h:3125
#define LoadCursor
Definition: winuser.h:5678
char szAppName[]
Definition: maze.c:78
UINT style
Definition: winuser.h:3116
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
HINSTANCE hInstance
Definition: winuser.h:3120
WNDPROC lpfnWndProc
Definition: winuser.h:3117
#define IDC_ARROW
Definition: winuser.h:682
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM uParam, LPARAM lParam)
Definition: maze.c:869
#define RegisterClass
Definition: winuser.h:5702
#define LoadIcon
Definition: winuser.h:5679
HICON hIcon
Definition: winuser.h:3121

Referenced by WinMain().

◆ initialize_maze()

static void initialize_maze ( )
static

Definition at line 139 of file maze.c.

140 {
141  register int i, j, wall;
142 
143  /* initialize all squares */
144  for ( i=0; i<maze_size_x; i++) {
145  for ( j=0; j<maze_size_y; j++) {
146  maze[i][j] = 0;
147  }
148  }
149 
150  /* top wall */
151  for ( i=0; i<maze_size_x; i++ ) {
152  maze[i][0] |= WALL_TOP;
153  }
154 
155  /* right wall */
156  for ( j=0; j<maze_size_y; j++ ) {
157  maze[maze_size_x-1][j] |= WALL_RIGHT;
158  }
159 
160  /* bottom wall */
161  for ( i=0; i<maze_size_x; i++ ) {
162  maze[i][maze_size_y-1] |= WALL_BOTTOM;
163  }
164 
165  /* left wall */
166  for ( j=0; j<maze_size_y; j++ ) {
167  maze[0][j] |= WALL_LEFT;
168  }
169 
170  /* set start square */
171  wall = get_random(4);
172  switch (wall) {
173  case 0:
175  j = 0;
176  break;
177  case 1:
178  i = maze_size_x - 1;
180  break;
181  case 2:
183  j = maze_size_y - 1;
184  break;
185  case 3:
186  i = 0;
188  break;
189  }
190  maze[i][j] |= START_SQUARE;
191  maze[i][j] |= ( DOOR_IN_TOP >> wall );
192  maze[i][j] &= ~( WALL_TOP >> wall );
193  cur_sq_x = i;
194  cur_sq_y = j;
195  start_x = i;
196  start_y = j;
197  start_dir = wall;
198  sqnum = 0;
199 
200  /* set end square */
201  wall = (wall + 2)%4;
202  switch (wall) {
203  case 0:
205  j = 0;
206  break;
207  case 1:
208  i = maze_size_x - 1;
210  break;
211  case 2:
213  j = maze_size_y - 1;
214  break;
215  case 3:
216  i = 0;
218  break;
219  }
220  maze[i][j] |= END_SQUARE;
221  maze[i][j] |= ( DOOR_OUT_TOP >> wall );
222  maze[i][j] &= ~( WALL_TOP >> wall );
223  end_x = i;
224  end_y = j;
225  end_dir = wall;
226 }
static int start_y
Definition: maze.c:124
#define get_random(x)
Definition: maze.c:110
#define WALL_RIGHT
Definition: maze.c:89
static int start_dir
Definition: maze.c:124
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int end_y
Definition: maze.c:124
static int maze_size_x
Definition: maze.c:121
#define DOOR_IN_TOP
Definition: maze.c:93
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define WALL_BOTTOM
Definition: maze.c:90
static long sqnum
Definition: maze.c:122
static int start_x
Definition: maze.c:124
static unsigned short maze[MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y]
Definition: maze.c:112
#define WALL_TOP
Definition: maze.c:88
static int maze_size_y
Definition: maze.c:121
static int end_x
Definition: maze.c:124
static int end_dir
Definition: maze.c:124
#define START_SQUARE
Definition: maze.c:104
#define END_SQUARE
Definition: maze.c:105
#define WALL_LEFT
Definition: maze.c:91
static int cur_sq_x
Definition: maze.c:123
static int cur_sq_y
Definition: maze.c:123
#define DOOR_OUT_TOP
Definition: maze.c:99

Referenced by WinMain().

◆ InitInstance()

static BOOL InitInstance ( HINSTANCE  hInstance,
int  nCmdShow 
)
static

Definition at line 790 of file maze.c.

793 {
794  /* Save the instance handle in static variable, which will be used in
795  many subsequence calls from this application to Windows. */
796 
797  hInst = hInstance; /* Store instance handle in our global variable */
798 
799  /* Create a main window for this application instance. */
800 
801  hWnd = CreateWindow(
802  szAppName, /* See RegisterClass() call. */
803  szTitle, /* Text for window title bar. */
804  WS_OVERLAPPEDWINDOW,/* Window style. */
805  0, 0, CW_USEDEFAULT, CW_USEDEFAULT, /* Use default positioning */
806  NULL, /* Overlapped windows have no parent. */
807  NULL, /* Use the window class menu. */
808  hInstance, /* This instance owns this window. */
809  NULL /* We don't use any data in our WM_CREATE */
810  );
811 
812  // If window could not be created, return "failure"
813  if (!hWnd) {
814  return (FALSE);
815  }
816 
817  // Make the window visible; update its client area; and return "success"
818  ShowWindow(hWnd, nCmdShow); // Show the window
819  UpdateWindow(hWnd); // Sends WM_PAINT message
820 
821  return (TRUE); // We succeeded...
822 
823 }
#define TRUE
Definition: types.h:120
#define CreateWindow
Definition: winuser.h:5620
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HINSTANCE hInstance
Definition: charmap.c:20
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
char szTitle[]
Definition: maze.c:79
HWND hWnd
Definition: maze.c:71
char szAppName[]
Definition: maze.c:78
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HINSTANCE hInst
Definition: maze.c:70

Referenced by WinMain().

◆ OnCreate()

static BOOL OnCreate ( HWND  hWnd,
LPCREATESTRUCT  lpCreateStruct 
)
static

Definition at line 826 of file maze.c.

827 {
828  RECT rc;
829  int size;
830 
831  srand((unsigned) time(NULL));
832 
833  size = GetPrivateProfileIntA("maze", "gridsize", 10, "maze.ini");
834  pre_solve_delay = GetPrivateProfileIntA("maze", "predelay", 5000, "maze.ini");
835  post_solve_delay = GetPrivateProfileIntA("maze", "postdelay", 5000, "maze.ini");
836  solve_delay = GetPrivateProfileIntA("maze", "solvedelay", 1, "maze.ini");
837 
838  if (size < 2) {
839  size = 7 + (rand() % 30);
840  }
842  bw = (size > 6 ? 3 : (size-1)/2);
843 
844  GetClientRect(hWnd, &rc);
845  set_maze_sizes(rc.right - rc.left, rc.bottom - rc.top);
846 
847  return TRUE;
848 }
#define TRUE
Definition: types.h:120
static int pre_solve_delay
Definition: maze.c:81
static int size
Definition: maze.c:76
void __cdecl srand(_In_ unsigned int _Seed)
LONG top
Definition: windef.h:292
static int grid_height
Definition: maze.c:125
__u16 time
Definition: mkdosfs.c:366
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
static int solve_delay
Definition: maze.c:81
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
smooth NULL
Definition: ftsmooth.c:416
static int post_solve_delay
Definition: maze.c:81
static void set_maze_sizes(int width, int height)
Definition: maze.c:130
GLsizeiptr size
Definition: glext.h:5919
HWND hWnd
Definition: maze.c:71
int bw
Definition: maze.c:377
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static int grid_width
Definition: maze.c:125
LONG bottom
Definition: windef.h:294
UINT WINAPI GetPrivateProfileIntA(LPCSTR section, LPCSTR entry, INT def_val, LPCSTR filename)
Definition: profile.c:1326

Referenced by WndProc().

◆ OnTimer()

void OnTimer ( HWND  hwnd,
UINT  id 
)

Definition at line 850 of file maze.c.

851 {
852  waiting = FALSE;
853 }
static BOOL waiting
Definition: maze.c:75

Referenced by WndProc().

◆ set_maze_sizes()

static void set_maze_sizes ( int  width,
int  height 
)
static

Definition at line 130 of file maze.c.

132 {
135 }
GLint GLint GLsizei width
Definition: gl.h:1546
static int grid_height
Definition: maze.c:125
static int maze_size_x
Definition: maze.c:121
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static int grid_width
Definition: maze.c:125
static int maze_size_y
Definition: maze.c:121

Referenced by OnCreate().

◆ solve_maze()

static int solve_maze ( )
static

Definition at line 537 of file maze.c.

538 {
539  int ret;
540  int action_done;
541 
542  do {
543  action_done = 1;
544  if ( ++path[pathi].dir >= 4 ) {
545  pathi--;
546  draw_solid_square( (int)(path[pathi].x), (int)(path[pathi].y),
547  (int)(path[pathi].dir), hDC, hBrushDead);
548  ret = 0;
549  }
550  else if ( ! (maze[path[pathi].x][path[pathi].y] &
551  (WALL_TOP >> path[pathi].dir)) &&
552  ( (pathi == 0) || ( (path[pathi].dir !=
553  (int)(path[pathi-1].dir+2)%4) ) ) ) {
555  pathi++;
556  if ( maze[path[pathi].x][path[pathi].y] & START_SQUARE ) {
559  ReleaseDC(hWnd, hDC);
560  ret = 1;
561  } else {
562  ret = 0;
563  }
564  } else {
565  action_done = 0;
566  }
567  } while (! action_done);
568 
569  return ret;
570 }
HDC hDC
Definition: maze.c:74
static void enter_square(int, HDC, HBRUSH)
Definition: maze.c:574
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static void draw_solid_square(int, int, int, HDC, HBRUSH)
Definition: maze.c:380
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
unsigned int dir
Definition: maze.c:112
HWND hWnd
Definition: maze.c:71
int ret
static int pathi
Definition: maze.c:127
static unsigned short maze[MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y]
Definition: maze.c:112
#define WALL_TOP
Definition: maze.c:88
Definition: services.c:325
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
HBRUSH hBrushLiving
Definition: maze.c:72
HBRUSH hBrushDead
Definition: maze.c:71
#define START_SQUARE
Definition: maze.c:104

Referenced by WinMain().

◆ start_timer()

static void start_timer ( HWND  hWnd,
int  iTimeout 
)
static

Definition at line 597 of file maze.c.

598 {
599  waiting = TRUE;
600  SetTimer(hWnd, 1, iTimeout, NULL);
601 }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
static BOOL waiting
Definition: maze.c:75
HWND hWnd
Definition: maze.c:71

Referenced by WinMain().

◆ WinMain()

int APIENTRY WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  nCmdShow 
)

Definition at line 624 of file maze.c.

629 {
630  MSG msg;
631  HDC hDC;
632 
633  if (!hPrevInstance) { /* Other instances of app running? */
634  if (!InitApplication(hInstance)) { /* Initialize shared things */
635  return (FALSE); /* Exits if unable to initialize */
636  }
637  }
638 
639  /* Perform initializations that apply to a specific instance */
640 
641  if (!InitInstance(hInstance, nCmdShow)) {
642  return (FALSE);
643  }
644 
645  waiting = FALSE;
646  state = 1;
647 
648  /* Acquire and dispatch messages until a WM_QUIT message is received. */
649 
650  while (0 != state) {
651  if (waiting) {
652  (void) WaitMessage();
653  }
654  while (0 != state && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
655  if (WM_QUIT == msg.message) {
656  state = 0;
657  } else {
658  DispatchMessage(&msg); /* Dispatches message to window */
659  }
660  }
661  switch (state) {
662  case 1:
663  initialize_maze();
664  state = 2;
665  break;
666  case 2:
667  hDC = GetDC(hWnd);
670  ReleaseDC(hWnd, hDC);
671  state = 3;
672  break;
673  case 3:
674  create_maze();
675  state = 4;
676  break;
677  case 4:
679  state = 5;
680  break;
681  case 5:
682  if (! waiting) {
683  state = 6;
684  }
685  break;
686  case 6:
688  if (0 != solve_delay) {
690  state = 7;
691  } else {
692  state = 8;
693  }
694  break;
695  case 7:
696  if (! waiting) {
697  state = 8;
698  }
699  break;
700  case 8:
701  if (! solve_maze()) {
702  if (0 != solve_delay) {
704  state = 7;
705  }
706  } else {
707  state = 9;
708  }
709  break;
710  case 9:
712  state = 10;
713  break;
714  case 10:
715  if (! waiting) {
716  state = 11;
717  }
718  break;
719  case 11:
720  state = 1;
721  break;
722  }
723  }
724 
725  return (msg.wParam); /* Returns the value from PostQuitMessage */
726 }
#define DispatchMessage
Definition: winuser.h:5631
#define PeekMessage
Definition: winuser.h:5696
static int state
Definition: maze.c:127
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static int pre_solve_delay
Definition: maze.c:81
HDC hDC
Definition: maze.c:74
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI WaitMessage(void)
Definition: ntwrapper.h:350
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static HDC
Definition: imagelist.c:92
#define WM_QUIT
Definition: winuser.h:1605
static void start_timer(HWND hWnd, int iTimeout)
Definition: maze.c:597
UINT_PTR WPARAM
Definition: windef.h:207
static int solve_delay
Definition: maze.c:81
static BOOL InitApplication(HINSTANCE hInstance)
Definition: maze.c:750
HINSTANCE hInstance
Definition: charmap.c:20
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static void create_maze()
Definition: maze.c:235
static int post_solve_delay
Definition: maze.c:81
static void initialize_maze()
Definition: maze.c:139
static BOOL waiting
Definition: maze.c:75
HWND hWnd
Definition: maze.c:71
static void begin_solve_maze()
Definition: maze.c:487
#define msg(x)
Definition: auth_time.c:54
#define SendMessage
Definition: winuser.h:5709
#define PM_REMOVE
Definition: winuser.h:1182
#define WM_ERASEBKGND
Definition: winuser.h:1607
static int solve_maze()
Definition: maze.c:537
static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
Definition: maze.c:790
static void draw_maze_border(HWND hWnd, HDC hDC)
Definition: maze.c:417

◆ WndProc()

LRESULT CALLBACK WndProc ( HWND  hWnd,
UINT  message,
WPARAM  uParam,
LPARAM  lParam 
)

Definition at line 869 of file maze.c.

874 {
875  PAINTSTRUCT ps;
876 
877  switch (message) {
878  case WM_CREATE:
880  break;
881  case WM_PAINT:
882  BeginPaint(hWnd, &ps);
883  state = 1;
884  EndPaint(hWnd, &ps);
885  case WM_TIMER:
886  OnTimer(hWnd, wParam);
887  break;
888  case WM_DESTROY: // message: window being destroyed
889  PostQuitMessage(0);
890  break;
891 
892  default: // Passes it on if unproccessed
893  return (DefWindowProc(hWnd, message, wParam, lParam));
894  }
895  return (0);
896 }
Definition: tftpd.h:59
static int state
Definition: maze.c:127
void OnTimer(HWND hwnd, UINT id)
Definition: maze.c:850
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
WPARAM wParam
Definition: combotst.c:138
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_TIMER
Definition: winuser.h:1718
HWND hWnd
Definition: maze.c:71
#define WM_PAINT
Definition: winuser.h:1602
#define WM_CREATE
Definition: winuser.h:1590
static BOOL OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
Definition: maze.c:826
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Referenced by InitApplication().

Variable Documentation

◆ bw

◆ cur_sq_x

int cur_sq_x
static

Definition at line 123 of file maze.c.

Referenced by backup(), choose_door(), create_maze(), and initialize_maze().

◆ cur_sq_y

int cur_sq_y
static

Definition at line 123 of file maze.c.

Referenced by backup(), choose_door(), create_maze(), and initialize_maze().

◆ dir

unsigned char dir

Definition at line 117 of file maze.c.

◆ dummy

unsigned char dummy

Definition at line 118 of file maze.c.

Referenced by __rpc_getconfip(), _authenticate(), _chm_get_cmpblock_bounds(), _tgetdcwd(), AddColumns(), AddListViewItems(), AttachConsole(), authdes_seccreate(), authnone_marshal(), cf2_hintmap_build(), cff_get_advances(), cff_slot_load(), check_type1_format(), child_process(), clnt_dg_freeres(), clnt_vc_freeres(), convertHexToDWord(), create_shortcut(), create_test_dll(), create_test_dll_sections(), dlg_configure_com(), dlgproc_addport(), dlgproc_lptconfig(), ExtCabCallback(), FT_Glyph_To_Bitmap(), ftGdiGetTextCharsetInfo(), get_item(), get_mmioFromFile(), get_server(), GetBatchVar(), GetDiaogTextureBrush(), getpass(), GetThemeServiceProcessHandle(), gluBuild1DMipmaps(), GRPFILE_ReadGroupFile(), GRPFILE_WriteGroupFile(), HGLOBALStreamImpl_Clone(), HTTP_HttpOpenRequestW(), CShellDispatch::IsServiceRunning(), ITERATE_StartService(), ios_base::iword(), ldap_add_extW(), ldap_delete_extW(), ldap_modify_extW(), listen_pipe(), LoadLibraryShim(), localui_AddPortUI(), localui_DeletePortUI(), LookupObjTypeMap(), named_pipe_client_func(), CExplorerBand::NavigateToCurrentFolder(), OLEPictureImpl_Save(), PROFILE_Open(), ps_mask_table_merge(), ps_tocoordarray(), ps_tofixedarray(), PTE_TO_PAGE(), ios_base::pword(), rdpdr_check_fds(), read_data(), read_keyboard_state(), restore_remote_modifiers(), rpc_broadcast(), RpcObjectSetType(), ScsiClassSendSrbSynchronous(), send_add_dir(), SendFilterMessage(), serverThreadMain3(), serverThreadMain4(), SetupCommitFileQueueW(), SHRegWriteUSValueW(), src_callback_read(), sspi_unwrap(), sspi_verify_mic(), sspi_wrap(), start_rpcss(), svc_reg(), TAB_LButtonDown(), test_condvars_base(), test_condvars_consumer_producer(), test_data_cache_save_data(), test_empty(), test_ExitProcess(), test_GetGlyphOutline(), test_GetObject(), test_HlinkClone(), test_HlinkGetSetMonikerReference(), test_import_resolution(), test_marshal_and_unmarshal_invalid(), test_metadata_APE(), test_metadata_GCE(), test_metadata_GIF_comment(), test_metadata_IMD(), test_metadata_LSD(), test_OpenProcess(), test_ParseURLFromOutsideSourceA(), test_ParseURLFromOutsideSourceW(), test_query_process_wow64(), test_ResolveDelayLoadedAPI(), test_RtlIpv4StringToAddress(), test_section_access(), test_service(), test_SetInitialHlink(), test_srwlock_base(), test_srwlock_example(), test_supporterrorinfo(), test_TerminateProcess(), test_xmlelem_collection(), test_XMLHTTP(), TestLockBytes_ReadAt(), TestLockBytes_WriteAt(), ThemeWaitForServiceReady(), TOOLBAR_Size(), TWAIN_ProcessEvent(), Usage(), USBD_GetDeviceInformationEx(), USBH_GetDeviceType(), VfdCheckDriverFile(), vgaWriteScan(), write_union_tfs(), xdr_multi_addr(), xdr_netbuf(), xdr_rpcb_rmtcallres(), and xdr_rpcblist().

◆ end_dir

int end_dir
static

Definition at line 124 of file maze.c.

Referenced by begin_solve_maze(), draw_maze_border(), and initialize_maze().

◆ end_x

int end_x
static

Definition at line 124 of file maze.c.

Referenced by begin_solve_maze(), draw_maze_border(), and initialize_maze().

◆ end_y

int end_y
static

Definition at line 124 of file maze.c.

Referenced by begin_solve_maze(), draw_maze_border(), and initialize_maze().

◆ grid_height

int grid_height
static

Definition at line 125 of file maze.c.

Referenced by draw_maze_border(), draw_solid_square(), draw_wall(), OnCreate(), and set_maze_sizes().

◆ grid_width

int grid_width
static

Definition at line 125 of file maze.c.

Referenced by draw_maze_border(), draw_solid_square(), draw_wall(), OnCreate(), and set_maze_sizes().

◆ hBrushDead

HBRUSH hBrushDead

Definition at line 72 of file maze.c.

◆ hBrushLiving

HBRUSH hBrushLiving

Definition at line 73 of file maze.c.

◆ hDC

HDC hDC

Definition at line 74 of file maze.c.

◆ hInst

HINSTANCE hInst

Definition at line 70 of file maze.c.

Referenced by InitInstance().

◆ hWnd

◆ maze

◆ maze_size_x

int maze_size_x
static

Definition at line 121 of file maze.c.

Referenced by draw_maze_border(), initialize_maze(), and set_maze_sizes().

◆ maze_size_y

int maze_size_y
static

Definition at line 121 of file maze.c.

Referenced by draw_maze_border(), initialize_maze(), and set_maze_sizes().

◆ move_list

struct { ... } move_list[MOVE_LIST_SIZE]

Referenced by backup(), and create_maze().

◆ path

struct { ... } path[MOVE_LIST_SIZE]

◆ path_length

long path_length
static

Definition at line 122 of file maze.c.

Referenced by create_maze().

◆ pathi

int pathi = 0
static

Definition at line 127 of file maze.c.

Referenced by begin_solve_maze(), and solve_maze().

◆ post_solve_delay

int post_solve_delay
static

Definition at line 81 of file maze.c.

Referenced by OnCreate(), and WinMain().

◆ pre_solve_delay

int pre_solve_delay
static

Definition at line 81 of file maze.c.

Referenced by OnCreate(), and WinMain().

◆ save_path

struct { ... } save_path[MOVE_LIST_SIZE]

Referenced by create_maze().

◆ solve_delay

int solve_delay
static

Definition at line 81 of file maze.c.

Referenced by OnCreate(), and WinMain().

◆ sqnum

long sqnum
static

Definition at line 122 of file maze.c.

Referenced by backup(), create_maze(), and initialize_maze().

◆ start_dir

int start_dir
static

Definition at line 124 of file maze.c.

Referenced by begin_solve_maze(), draw_maze_border(), and initialize_maze().

◆ start_x

int start_x
static

Definition at line 124 of file maze.c.

Referenced by begin_solve_maze(), draw_maze_border(), and initialize_maze().

◆ start_y

int start_y
static

Definition at line 124 of file maze.c.

Referenced by begin_solve_maze(), draw_maze_border(), and initialize_maze().

◆ state

int state = 1
static

Definition at line 127 of file maze.c.

Referenced by WinMain(), and WndProc().

◆ szAppName

char szAppName[] = "Maze"

Definition at line 78 of file maze.c.

Referenced by InitApplication(), and InitInstance().

◆ szTitle

char szTitle[] = "Maze"

Definition at line 79 of file maze.c.

Referenced by InitInstance().

◆ waiting

BOOL waiting
static

Definition at line 75 of file maze.c.

Referenced by Draw_Sweep(), OnTimer(), start_timer(), and WinMain().

◆ x

unsigned char x

Definition at line 115 of file maze.c.

◆ y

unsigned char y

Definition at line 116 of file maze.c.