diff options
author | scratko <m@scratko.xyz> | 2024-04-07 03:07:42 +0300 |
---|---|---|
committer | scratko <m@scratko.xyz> | 2024-04-07 03:07:42 +0300 |
commit | 2c2448cc94b8f17ac699814a75110411d57f3bea (patch) | |
tree | 4107fa66264cda94dd01c3bb00da29945c8d6131 /ghosts.h | |
parent | bdee2852c13f6b02ec5207ded584839a3118233e (diff) | |
download | pacman-2c2448cc94b8f17ac699814a75110411d57f3bea.tar.gz pacman-2c2448cc94b8f17ac699814a75110411d57f3bea.tar.bz2 pacman-2c2448cc94b8f17ac699814a75110411d57f3bea.zip |
BFS, queue files
Fixed remaining direction check for pacman (old version was commented out).
Breadth First Search for red ghost.
Changed switch style.
Diffstat (limited to 'ghosts.h')
-rw-r--r-- | ghosts.h | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -11,7 +11,7 @@ enum { pink_y = red_y + 1, pink_x = red_x - 2, pink_home_y = red_home_y, - pink_home_x = 1, + pink_home_x = 2, blue_y = red_y, blue_x = red_x-1, blue_home_y = 29, @@ -20,7 +20,6 @@ enum { orange_x = red_x - 3, orange_home_y = blue_home_y, orange_home_x = 0, - field_size = 29 }; enum ghost_color { red, pink, blue, orange }; @@ -43,9 +42,9 @@ struct ghost_type { void initialize_ghost(struct ghost_type *ghost, enum ghost_color color); void pull_out_ghosts(int *get_out_stage, - struct ghost_type *red_ghost, + struct ghost_type *red_ghost, struct ghost_type *pink_ghost, - struct ghost_type *blue_ghost, + struct ghost_type *blue_ghost, struct ghost_type *orange_ghost); void make_ghost_moves(game_space field, @@ -54,12 +53,13 @@ void make_ghost_moves(game_space field, struct ghost_type *blue_ghost, struct ghost_type *orange_ghost); -void redirect(game_space field, enum intersection_type paths, - struct ghost_type *ghost, - void (*pathfinder)(game_space field, enum intersection_type paths, - struct ghost_type *ghost)); +struct pacman; +void redirect(game_space field, enum intersection_type paths, + struct ghost_type *ghost, struct pacman pac, + void (*pathfinder)(game_space, struct ghost_type*, + struct pacman pac)); -void breadth_first_search(game_space field, enum intersection_type paths, - struct ghost_type *ghost); +void breadth_first_search(game_space field, struct ghost_type *ghost, + struct pacman pac); #endif |