3 Commits

Author SHA1 Message Date
swipelab
6f7d2f4db2 lang migration: rename signed integer types sN -> iN
Mechanical sweep of all .sx sources, plan docs, and tests/expected
snapshots for the sx language rename (s8/s16/s32/s64 -> i8/i16/i32/i64).
Verified: tools/run_tests.sh 23/23.

Note: the ios-sim build has 2 pre-existing 'restart' dot-call errors
from the sx opt-in UFCS change (sx a47ea14) — independent of this
rename (present pre-sweep); migrated in the follow-up commit.
2026-06-12 09:36:51 +03:00
swipelab
a7b41ccbca migrate to the new for-loop syntax
Drop the ':' before captures (for xs (x) / for 0..n (i)); the index
capture becomes the trailing open range (for xs, 0.. (x, i)). 136
headers across 26 files, mechanical.

Five headless tests (banner_layout, hit_test, swipe_commit,
swipe_intent, swipe_reshuffle) also gain a direct
#import "modules/ui/types.sx" — they named Point/Frame through a
transitive import, which bare visibility no longer permits.

Gates: sx build --target ios-sim main.sx links; tools/run_tests.sh
23/23.
2026-06-10 20:39:59 +03:00
swipelab
2ff3d6e609 P3.3: turn accounting + special-match flagging (pure sx)
Extend the pure-sx board model with the model-level pieces P5 (input) and
P7 (turn/goal loop) will call:

- Turn accounting on Board: `moves_made` + configurable `move_limit`
  (DEFAULT_MOVE_LIMIT), with `moves_remaining()` derived from the two so
  the counters can't drift. `init` resets them.
- Special-match flagging: `count_specials` tallies a detection round's
  maximal runs of length exactly 4 and length 5+, surfaced over a whole
  settle as Cascade.len4 / len5_plus (+ had_len4 / had_len5_plus). A hook
  for future special gems — detection only, no gem behavior.
- `commit_swap`: the single player-move entry point. Legal swap → apply,
  resolve (scoring accrues), spend one move; illegal → revert, no move
  spent. Returns a PlayerMove with the settle's payout + special flags.

Adds tests/turn.sx (+ golden) asserting: legal swap decrements the move
counter by exactly 1 and accrues score; illegal swap leaves counter,
score and board untouched; len4/len5+/len3 rounds set the documented
flags. Existing goldens unchanged; ios-sim build compiles.
2026-06-04 21:36:19 +03:00