aboutsummaryrefslogtreecommitdiff
path: root/examples/std_tour.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 09:42:25 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 09:42:25 +0330
commitde4da84ca3159ad0ebcf13729716be5f4d7bbc2a (patch)
tree216f00007206fdc15dccd3327884b4c0dad94446 /examples/std_tour.zc
parentxref: baseline records the prover's writers of ft_ln (bin, kw_for), xub and x... (diff)
std: add std.Io (print, println, nl, put_*, put_f, get_c, eof, read, getline) with test, learn example and docs
Diffstat (limited to 'examples/std_tour.zc')
-rw-r--r--examples/std_tour.zc3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/std_tour.zc b/examples/std_tour.zc
index df4d02b..1ef33f3 100644
--- a/examples/std_tour.zc
+++ b/examples/std_tour.zc
@@ -9,6 +9,9 @@ int dbl(int x) { return x * 2; }
int add(int a, int b) { return a + b; }
fn main() {
+ // io: the terminal
+ std.Io.print("io "); std.Io.put_n(7); std.Io.put_c(' '); std.Io.put_f(0.5); std.Io.nl(); // io 7 0.500000
+
// text: char* strings, one character per word
let buf[32];
std.Text.itoa(0 - 42, buf); rt.put_s(buf); rt.put_c(10); // -42