implement Tmpl0; include "sys.m"; sys: Sys; print: import sys; include "draw.m"; include "bufio.m"; bufio: Bufio; Iobuf, EOF: import bufio; include "math.m"; math: Math; sin: import math; include "ffts.m"; ffts: FFTs; Tmpl0: module {init: fn(nil: ref Draw->Context, argv: list of string);}; init(nil: ref Draw->Context, nil: list of string) { sys = load Sys Sys->PATH; math = load Math Math->PATH; bufio = load Bufio Bufio->PATH; ffts = load FFTs FFTs->PATH; n := 0; y:= array[8] of int; io := bufio->fopen(sys->fildes(0), bufio->OREAD); for(;;){ (b, eof) := getw(io); if(eof) break; if(n >= len y) y = (array[len y * 2] of int)[0:] = y; y[n++] = b; } for(i:=0;i> 16, 0); }