Language: named colors, namespaced Screen/Input/Random/Map API, named args

An opinionated, game-facing surface for the language:
- Color.<Name>: 221 named colors resolved to 0xRRGGBB at compile time
  (selfhost/emit_color.ludic).
- Namespaced builtins Screen.* / Input.key / Random.* / Map.*, so calls read as
  subject.action; present() -> Screen.show(), clear -> Screen.clear,
  fill_rect -> Screen.fill_rectangle, etc.
- Named arguments, e.g. Screen.fill_rectangle(x:, y:, width:, height:, color:),
  reordered to the callee's parameters at emit time.
- machine/become can run over a named program-scope var, not just a register.
- Migrate examples off numeric registers to named vars; snake/menu/chronorift
  render byte-identical to the goldens and the bootstrap fixpoint is preserved.
- Regenerate the checked-in seed (selfhost/ludicc.seed.ll).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-08-29 16:05:55 +03:00
parent 9e4837428c
commit a3a1e4d160
14 changed files with 11784 additions and 7493 deletions

View file

@ -29,15 +29,15 @@ const SPR_MAGE: int = 9
const SPR_FLOOR: int = 10
const SPR_WALL: int = 11
const R_MODE: int = 0 # 0 field, 1 battle, 2 gameover, 3 victory
const R_PHASE: int = 1
const R_CUR: int = 2
const R_ENC: int = 3
const R_ETYPE: int = 4 # 0 slime, 1 skeleton, 2 boss
const R_PDMG: int = 5
const R_EDMG: int = 6
const R_GOLD: int = 7
const R_MAP: int = 8 # 0 overworld, 1 dungeon
const R_BOSS: int = 9 # boss defeated flag
const R_ACK: int = 10 # debounce for end screens
const R_POTION: int = 11 # potions in inventory
var game_mode: int = 0 # 0 field, 1 battle, 2 gameover, 3 victory
var turn_phase: int = 0
var menu_cursor: int = 0
var encounter: int = 0
var enemy_type: int = 0 # 0 slime, 1 skeleton, 2 boss
var player_hit: int = 0
var enemy_hit: int = 0
var gold: int = 0
var world_map: int = 0 # 0 overworld, 1 dungeon
var boss_down: int = 0 # boss defeated flag
var ack: int = 0 # debounce for end screens
var potions: int = 0 # potions in inventory