diff options
| author | Tyge Løvset <[email protected]> | 2022-12-23 23:55:10 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-23 23:55:10 +0100 |
| commit | d623c6c85071b9af5d607bb5d9aceceaea05220a (patch) | |
| tree | f20fc3714f86e1553d1103bed6dc8efefcbd9d6b /misc/examples/astar.c | |
| parent | 5f57d597cd27aef55adbcb3b452973b0c6e33667 (diff) | |
| download | STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.tar.gz STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.zip | |
Experimental uppercase macros.
Diffstat (limited to 'misc/examples/astar.c')
| -rw-r--r-- | misc/examples/astar.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/examples/astar.c b/misc/examples/astar.c index d4a821f9..e308eb78 100644 --- a/misc/examples/astar.c +++ b/misc/examples/astar.c @@ -80,9 +80,9 @@ astar(cstr* maze, int width) { cdeq_point path = cdeq_point_init(); - c_auto (cpque_point, front) - c_auto (csmap_pstep, from) - c_auto (csmap_pcost, costs) + c_AUTO (cpque_point, front) + c_AUTO (csmap_pstep, from) + c_AUTO (csmap_pcost, costs) { point start = point_from(maze, "@", width); point goal = point_from(maze, "!", width); @@ -99,7 +99,7 @@ astar(cstr* maze, int width) { -1, 0, 0, width }, /* ~ ~ ~ ~ ~ ~ ~ */ { 1, 0, 0, width }, { -1, -1, 0, width }, { 0, -1, 0, width }, { 1, -1, 0, width }, }; - for (size_t i = 0; i < c_arraylen(deltas); i++) + for (size_t i = 0; i < c_ARRAYLEN(deltas); i++) { point delta = deltas[i]; point next = point_init(current.x + delta.x, current.y + delta.y, width); @@ -131,7 +131,7 @@ astar(cstr* maze, int width) int main(void) { - c_with (cstr maze = cstr_lit( + c_WITH (cstr maze = cstr_lit( "#########################################################################\n" "# # # # # # #\n" "# # ######### # ##### ######### ##### ##### ##### # ! #\n" @@ -157,9 +157,9 @@ main(void) "#########################################################################\n"), cstr_drop(&maze)) { int width = cstr_find(&maze, "\n") + 1; - c_with (cdeq_point path = astar(&maze, width), cdeq_point_drop(&path)) + c_WITH (cdeq_point path = astar(&maze, width), cdeq_point_drop(&path)) { - c_foreach (it, cdeq_point, path) cstr_data(&maze)[point_index(it.ref)] = 'x'; + c_FOREACH (it, cdeq_point, path) cstr_data(&maze)[point_index(it.ref)] = 'x'; printf("%s", cstr_str(&maze)); } } |
