Here's another way to do the same thing which *might* be quicker as it avoids the string and number conversion functions (I haven't tested it!) It also means the data and its descriptors (transparent colour and 'width' are self contained and therefore easier to keep clean/debug) and the numbers are decimals rather than hex. You could even put the drawing function in the table and have it draw itself.
-- drawarray
local test={data={2,2,2,2,2,2,2,2,
2,0,0,0,0,0,0,2,
2,0,0,0,0,0,0,2,
2,0,0,4,4,0,0,2,
2,0,0,4,4,0,0,2,
2,0,0,0,0,0,0,2,
2,0,0,0,0,0,0,2,
2,2,2,2,2,2,2,2},
trans=0,
width=8
}
--x,y,table
function drawArray(x,y,a)
local startx=x
for i=1,#a.data do
local cc=a.data[i]
if(cc~=a.trans) then
pix(x,y,cc)
end
x=x+1
if (i)%a.width==0 then
y=y+1
x=startx
end
end
end
function TIC()
cls()
drawArray(120,60,test)
end
Hope that's of interest!