pete286/jiles.jor

40 lines
698 B
Plaintext
Executable file

: blah ' seremit task-emit ! ;
blah
s" game.log" open seekend fdeactivate const LOGFILE
: emit-log ' fputc LOGFILE withfp ;
: atexit LOGFILE factivate close ;
: start-repl activate blah ' emit-log task-echo !
s" .:: J O R T H ( jean forth) ::." type cr
begin receive loadstring s" ok" type cr again ;
task const REPL
REPL start-repl
intern input.jor
input.jor loadfile
var color
var spriteindex
8 spriteindex !
2 color !
: refresh
spriteindex @ drawfatsprite ;
: mousepos>sprpos 3 >> swap 3 >> swap ;
: tick
MOUSEL clicked if
color @ mousepos mousepos>sprpos spriteindex @ putpixel
then
tick-debounce
;
: draw ;
mouseshow
refresh