8-Puzzle
Slide the tiles back to 1 2 3 / 4 5 6 / 7 8 _. Two ways to use Jev in search: let code run a beam search while Jev ranks boards (the pattern TypeSafe recommends), or ask Jev to count the moves left for A* (a stress test of a documented weakness). Both are compared with the textbook Manhattan distance.
In scopeCode runs the search and keeps a visited set; Jev only answers a comparative Choice, “which of these boards is closest to being solved?”, for the unvisited successors of each board in the beam. A path scores the sum of log-probabilities; the best paths survive each step, with the beam widened (1, 2, 3, 5, 8, 13) and rankings reused whenever a pass fails, as in the benchmark. The baseline ranks the same options by Manhattan distance. Budget: 300 distinct Jev rankings. TypeSafe: keep control flow in code
Run “Jev ranks”. Each call compares the unvisited successors of one board.