So if you want to see a little retro like Lua interpreter, grab it on http://cmb.retrogamecoding.org/ (The zip contains binaries for Windows and Linux 32 & 64 bit). It might benecessary to instal liblua5.2 on Linux.
Here's an example script for ChipmonkeyLua:
Code:
--' my favourite plasma demo
--' ported from smallbasic to yabasic to lua with CMLua
--' by cybermonkey
activepage (1)
cls()
cols={}
cols[0]={}
cols[1]={}
cols[2]={}
for i=0,255 do
cols[0][i]= math.abs(128 - 127 * math.sin(i * math.pi / 32))
cols[1][i]= math.abs(128 - 127 * math.sin(i * math.pi/ 64))
cols[2][i]= math.abs(128 - 127 * math.sin(i * math.pi / 128))
end
time1=gettickcount()
for y = 1,599 do
for x =1,799 do
c = int((math.sin(x/35)*128+math.sin(y/28)*32 + math.sin((x+y)/16)*64))
if c >255 then
c = c - 256
end
if c < 0 then
c = 256 + c
end
r = cols[0][c]
if r > 255 then
r = r - 256
end
if r < 0 then
r = 256 + c
end
g = cols[1][c]
if g >255 then
g = g - 256
end
if g < 0 then
g = 256 + c
end
b = cols[2][c]
if b>255 then
b = b - 256
end
if b < 0 then
b = 256 + c
end
ink ( hrgb (r, g, b))
pset (x, y)
end
end
time2=gettickcount()
ink (hrgb (0,200,200))
locate (0,40,"")
print ("Time needed: "..(time2-time1).." ms")
visualpage(1)
The result is this:
cmlua1.jpg
All is done in Free Pascal using (hold your breath ...): ptcgraph, ptccrt and ptcmouse units.
It also has an interactive mode which looks like a vintage BASIC interpreter.
cmlua3.jpg
Bookmarks