True. pas.f in Forth
: .r u.r ;
: position ( row -- ) cr 33 swap 2 * - spaces ;
: pas ( 0 ... 0 -- 0 ... 0 ) 0 >r begin
over + >r dup 0= until
begin r> dup while dup 4 .r repeat ;
: pass ( -- ) 0 1 0 18 0 ?do dup position >r pas r> 1+ loop drop ;
: pax ( 0 ... 0 -- ) drop begin 0= until ;
: pascal ( -- ) pass pax ;
pascal
cr
The same mod2: : .r u.r ;
: position ( row -- ) cr 33 swap 2 * - spaces ;
: pas ( 0 ... 0 -- 0 ... 0 ) 0 >r begin
over + >r dup 0= until
begin r> dup while dup 2 mod 4 .r repeat ;
: pass ( -- ) 0 1 0 18 0 ?do dup position >r pas r> 1+ loop drop ;
: pax ( 0 ... 0 -- ) drop begin 0= until ;
: pascal ( -- ) pass pax ;
pascal
cr
A Forth for people in a hurry: git clone https://github.com/howerj/subleq
cd subleq
sed -i 's,0 constant opt.control,1 constant opt.control,g' subleq.fth
gmake subleq
./subleq subleq.dec < subleq.fth > new.dec
./subleq new.dec < pas.f