diff options
| author | Cliff Click <cliffc@acm.org> | 2026-08-10 11:11:18 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-11-13 13:35:58 -0800 |
| commit | 870c822ce26bd866761f6abd71fd9e109b9d9d98 (patch) | |
| tree | 65b1d43dcc5e1085e15d301c5ff628d9dcfd483e /src/main/smp/sys/text.smp | |
| parent | 2cb35c65bde63f90d7afc3d7a8a985b0c6ea15d7 (diff) | |
| download | Simple-870c822ce26bd866761f6abd71fd9e109b9d9d98.tar.gz Simple-870c822ce26bd866761f6abd71fd9e109b9d9d98.zip | |
Chapter 31: Software Drawing, Time, and Graphical Games
Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com>
Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com>
Co-authored-by: Symious <14933944+symious@users.noreply.github.com>
Co-authored-by: Jun Kawasaki <jun784@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/main/smp/sys/text.smp')
| -rw-r--r-- | src/main/smp/sys/text.smp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/smp/sys/text.smp b/src/main/smp/sys/text.smp index a414ff45..a28edf6d 100644 --- a/src/main/smp/sys/text.smp +++ b/src/main/smp/sys/text.smp @@ -96,3 +96,8 @@ val f64 = { f64 x -> end(floating(begin(),x, 0 ,0,-1)); }; val char = { i64 x -> end(integer (begin(),x,'c',0,-1)); }; val bool = { bool x -> end(integer (begin(),x,'b',0,-1)); }; val hex = { i64 x -> end(integer (begin(),x,'x',0,-1)); }; + +// Time selectors occupy spec bits 16..23; padding shares string formatting. +val time = { !aryu8 b, i64 value, i64 spec, i64 width, i64 precision -> + string(b,sys.time.format(value,(spec>>>16)&255),spec,width,-1); +}; |
