>? ̐ ̐ ̀  ̐  ̀  X-- title: tile pattern generator -- author: potato imaginator -- desc: Press UP / DOWN / LEFT / RIGHT to move . Press 'Z' / 'X' to change Colors . Press 'A' to Reset -- script: lua a={} for i=0,15 do a[i]={} for j=0,9 do a[i][j]= {c1=math.random(0,1), c2=math.random(0,1)} end end color={[0]=1,2,3,5,6,8,9,10} x,y=0,0 -- x , y position dx,dy=0,0 ind=0 col=color[ind] function draw() for i=0,15 do for j=0,9 do for k=-1,0 do for l=-1,0 do for m=-1,1 do for n=-1,1 do rect (16*i+x+k-2+256*m, 16*j+y+l+160*n, 5,1,col+a[i][j].c1) rect (16*i+x+k+256*m, 16*j+y+l-2+160*n, 1,5,col+a[i][j].c1) circ (16*i+8+k+x+256*m, 16*j+8+l+y+160*n, 3,col+a[i][j].c2) end end end end end end end function TIC() cls() for i=0,15 do for j=0,9 do for k=-1,1 do for l=-1,1 do rect (16*i+x+256*k,16*j+y+160*l, 16,16,col+(i+j)%2) end end end end draw() if btn(0) then dy=math.min(dy+1/4,2.5) elseif btn(1) then dy=math.max(dy-1/4,-2.5) end if btn(2) then dx=math.min(dx+1/4,2.5) elseif btn(3) then dx=math.max(dx-1/4,-2.5) end x=x+dx y=y+dy dx=dx/1.02 dy=dy/1.02 if x<-64 then x=x+256 elseif x>64 then x=x-256 end if y<-40 then y=y+160 elseif y>40 then y=y-160 end if btnp(4) then ind=(ind-1)%8 elseif btnp(5) then ind=(ind+1)%8 end if btnp(6) then reset() end col=color[ind] for i=-1,1 do for j=-1,1 do print ('Color = '..(ind+1),10+i,10+j,0) end end print('Color = '..(ind+1),10,10,12) end