plop
programming language on p8so
"string"
$variable
:tag
;comment
eval target a op b
chr target a
ord target a
idx target str i
join target a b
cls color
print text x y color
spr id x y w h flip
rect x1 y1 x2 y2 color
oval x1 y1 x2 y2 color
rectfill x1 y1 x2 y2 color
ovalfill x1 y1 x2 y2 color
cpyglb name target
store target value
goto tag
if a op b tagt tagf
filenew name data
filewrite name data
filedel name
filelist target
flip
exit
0:'print "hello`n`qworld`q" $x $y 7'
1:{ --split by string delimiter
'print ',
'hello`n`qworld`q',
' $x $y 7'
}
2:{ --unescape escape codes `n `q and `` to \n " and `
'print ',
[hello
"world"],
' $x $y 7'
}
note: the string here will be shown as just 'hello world' from now on
3:{ --mark every even index by if its a string or not ((idx-1)%2), and dont do further parsing on them, and also remove things after ;
{0,'print '},
{1,'hello world'},
{0,' $x $y 7'}
}
4:{ --split every non string by spaces (trim first)
{0,'print'},
{1,'hello world'},
{0,'$x'},
{0,'$y'},
{0,'7'}
}
4.5 --unpack
5:{ --parse variables
{0,'print'},
{1,'hello world'},
{0,'27'},
{0,'54'},
{0,'7'}
}
6:{ --tonum (except first)
{0,'print'},
{1,'hello world'},
{0,27},
{0,54},
{0,7}
}
7:{ --deparse
'print',
'hello world',
27,
54,
7
} |
[Please log in to post a comment]




