examples: cmatrix — ww + libncurses falling-glyph demo
Exercises match/yield/?/!/alloc/free/slice/tagged-union end-to-end: the @symbol FFI binds initscr/mvaddch/init_pair/getch/napms; setup returns (*void | initerr) propagated via `?`; main unwraps the clock via `!`; dispatch is a nested match-as-expression that yields a bool; key handlers fold into switch/enum (q/space) and (i32 | speederr | void) for 1..4 + the '0' error overlay. No definite or indirect leaks under valgrind (the only "possibly lost" / "still reachable" bytes are libncurses's process-lifetime terminfo caches, freed only with --with-leaks).
This commit is contained in:
12
examples/cmatrix/Makefile
Normal file
12
examples/cmatrix/Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
# examples/cmatrix — Matrix-style falling glyphs, built with the ww
|
||||
# toolchain. Links against libncurses.so via w6l's dynamic linker.
|
||||
|
||||
WW := $(shell cd ../..; pwd)/out/bin/ww
|
||||
|
||||
cmatrix: cmatrix.ww
|
||||
$(WW) build cmatrix.ww -L /usr/lib -l ncurses
|
||||
|
||||
clean:
|
||||
rm -f cmatrix cmatrix.o cmatrix.s cmatrix.combined.ww
|
||||
|
||||
.PHONY: clean
|
||||
Reference in New Issue
Block a user