Add swipe.sx: a pure swipe_intent(layout, start, end) -> ?Swap that turns a touch drag into an optional adjacent-swap intent (A, B). A is the cell under the drag start (via BoardLayout.point_to_cell); B is its orthogonal neighbour along the drag's dominant axis (larger of |dx|,|dy|, ties horizontal). Returns null for sub-threshold drags (a tap, threshold = cell_size * 0.5), starts off the board, or neighbours off the board. No rendering, no model mutation. Lock the logic with tests/swipe_intent.sx (+ expected golden), feeding synthetic down/up positions for right/left/up/down, sub-threshold tap, diagonal→dominant (both axes), edge-outward off-board, and start-off-board. bash tools/run_tests.sh passes (13/13); sx build --target ios-sim main.sx compiles.
2.5 KiB
2.5 KiB