diff options
| author | Tyge Løvset <[email protected]> | 2023-02-08 16:16:49 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-08 17:18:24 +0100 |
| commit | c4441f5fc665194fbd7a894a67a64a08c3beac42 (patch) | |
| tree | 82f231b6e8fcb75625166f98aa785baaa265a3d6 /misc/examples/astar.c | |
| parent | 673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff) | |
| download | STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip | |
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'misc/examples/astar.c')
| -rw-r--r-- | misc/examples/astar.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/examples/astar.c b/misc/examples/astar.c index ddc9de3a..10e45d3c 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); @@ -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 = (int)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) + c_foreach (it, cdeq_point, path) cstr_data(&maze)[point_index(it.ref)] = 'x'; printf("%s", cstr_str(&maze)); |
