ludic/examples
Orkuncakilkaya b5455cd550
Some checks are pending
docs / build-and-deploy (push) Waiting to run
feat(stdlib): DateTime format/parse + simulated Clock — completes #9
Finish issue #9 by adding the two remaining acceptance items on top of the
calendar/clock core, still pure-integer and deterministic:

  DateTime.format(dt, pattern) -> string   render an instant via a token
                                           pattern (YYYY/YY/MM/DD/HH/mm/ss;
                                           other chars pass through)
  DateTime.parse(text, pattern) -> int     read an instant back; -1 on a
                                           non-digit where one is expected
  Clock.now/set/advance/reset              a game-controlled simulated clock
                                           (the @L_clock global) that never
                                           touches the wall clock, so gameplay
                                           reading Clock.now() is replay-safe

format/parse take a string-LITERAL pattern and are expanded at compile time
(field offsets are then constant), folding @fn_str_concat over literal runs and
two small runtime helpers: @fn_dt_pad0 (zero-padded field) and @fn_dt_rd
(fixed-width digit reader that stops at the terminator and flags malformed
input). Clock is a universal i32 global declared in emit_head, so it works in
entry and game programs alike.

Adds examples/offline_rewards.ludic — the issue's worked "you were away N hours"
example, driven from its own entry and asserted in the regression suite — plus
selfhost/tests/datetime2.ludic (format/parse round-trip, parse failure, clock),
docs (Clock section + 4 pages, DateTime.format/parse pages), inventory and LSP
hover. Reseeded; C-free fixpoint holds; all suites green (27 self-host / 46
regression / 29 tools); check.py (366 symbols), check-impl.py (218 ns-methods)
and validate.py OK.

With this, #9's scope is fully delivered: DateTime/Date/Duration + core ops,
format/parse, a deterministic simulated clock, docs + offline-rewards example,
and tests. (v1 stays UTC-only, no leap seconds, i32 epoch valid through 2038.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-30 03:51:48 +03:00
..
chronorift refactor(lang): rename the str type (and stringify builtin) to string 2026-08-30 01:51:11 +03:00
lib refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
annotations.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
cancel.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
chronorift.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
detach.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
draw_prims.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
events.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
hello.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
layer_events.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
lifecycle.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
menu.ludic Language: named colors, namespaced Screen/Input/Random/Map API, named args 2026-08-29 16:05:55 +03:00
mod_events.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
net_demo.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
net_echo.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
net_owner.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
net_roles.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
net_rpc.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
net_rt.ludic refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
net_snapshot.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
net_sync.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
offline_rewards.ludic feat(stdlib): DateTime format/parse + simulated Clock — completes #9 2026-08-30 03:51:48 +03:00
program_events.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
promote.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
prop_events.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
qdecl.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
reason.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
recurse.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
rng_demo.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
scene_events.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
scenes.ludic Language: named colors, namespaced Screen/Input/Random/Map API, named args 2026-08-29 16:05:55 +03:00
scoped.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
snake.ludic refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
strings.ludic Phase 7h: string slicing s[a..b] (retire substr) 2026-08-28 01:35:24 +03:00
time_demo.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
toggle.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
world_dyn.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
world_get.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
world_mixed.ludic refactor(lang): rename the ptr/ptrs types to pointer/pointers 2026-08-30 01:58:54 +03:00
world_query.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
world_scan.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
world_spawn.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00