wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run

ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic
  1804 vars into 126 states, 64 into lets; 23498 edits in 460 files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 15:31:34 +03:00
parent 5ffe50ed02
commit 19fcf60599
459 changed files with 17862 additions and 17603 deletions

View file

@ -1,21 +1,21 @@
# queries.ludic - what the world asks the clock
export function clock_day() -> int { return ck_day }
export function clock_hours() -> float { return ck_hours }
export function clock_moon() -> float { return ck_moon }
export function clock_scale() -> float { return ck_scale }
export function clock_day(clock_st: ClockState) -> int { return clock_st.ck_day }
export function clock_hours(clock_st: ClockState) -> float { return clock_st.ck_hours }
export function clock_moon(clock_st: ClockState) -> float { return clock_st.ck_moon }
export function clock_scale(clock_st: ClockState) -> float { return clock_st.ck_scale }
# game seconds per real second right now, the rest speed-up included
export function clock_rate() -> float { return ck_scale * ck_rest() }
export function clock_rate(clock_st: ClockState) -> float { return clock_st.ck_scale * ck_rest() }
# the game hours `dt` real seconds are worth at the current rate
export function clock_hours_in(dt: float) -> float { return dt * clock_rate() / 3600.0 }
export function clock_hours_in(clock_st: ClockState, dt: float) -> float { return dt * clock_rate(clock_st) / 3600.0 }
export function clock_is_night() -> bool { return ck_hours > ck_night_from or ck_hours < ck_night_to }
export function clock_is_night(clock_st: ClockState) -> bool { return clock_st.ck_hours > clock_st.ck_night_from or clock_st.ck_hours < clock_st.ck_night_to }
# "07:05"
export function clock_hhmm() -> string {
let h = int(Math.floor(ck_hours))
let m = int(Math.floor((ck_hours - float(h)) * 60.0))
export function clock_hhmm(clock_st: ClockState) -> string {
let h = int(Math.floor(clock_st.ck_hours))
let m = int(Math.floor((clock_st.ck_hours - float(h)) * 60.0))
var hs = `{h}`
var ms = `{m}`
if h < 10 { hs = `0{h}` }