roc/crates/cli/tests/benchmarks/test_a_star.roc
Jan 68e524e110
snake_case-ify all remaining camelCase names in hiding (#7561)
* Snake-case-ify def names in comments

* Snake-case-ify def names in strings

* Snake-case-ify ignored function parameters

* Snake-case-ify test script names, for consistency

* Update CI snapshot to match snake_case

* snake case correction

---------

Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-02-05 16:05:03 +01:00

37 lines
667 B
Text

app [main!] { pf: platform "platform/main.roc" }
import pf.Host
import AStar
main! = \{} ->
Host.put_line!(show_bool(test1))
show_bool : Bool -> Str
show_bool = \b ->
if
b
then
"True"
else
"False"
test1 : Bool
test1 =
example1 == [2, 4]
example1 : List I64
example1 =
step : I64 -> Set I64
step = \n ->
when n is
1 -> Set.from_list([2, 3])
2 -> Set.from_list([4])
3 -> Set.from_list([4])
_ -> Set.from_list([])
cost : I64, I64 -> F64
cost = \_, _ -> 1
when AStar.find_path(cost, step, 1, 4) is
Ok(path) -> path
Err(_) -> []