Skip to content

Instantly share code, notes, and snippets.

View Vladar4's full-sized avatar
I may be slow to respond.

Vladimir Arabadzhi Vladar4

I may be slow to respond.
View GitHub Profile
@Vladar4
Vladar4 / ctree.fs
Created January 23, 2017 21:11
christmas tree in gforth
: spc 32 ;
: half ( n -- n/2 ) 2 / ;
: rep ( c n -- ) 0 do dup emit loop drop ;
: top ( width -- ) cr dup 3 rot 2 mod - + half spc swap rep '* emit ;
: line ( width index -- )
cr dup rot 2 + 2 / swap - spc swap rep