m={}for x=1,12 do m[x]={}for y=1,12 do m[x][y]=0 if x==1 or x==12 or y==1 or y==12 then m[x][y]=1 elseif x%2==1 and y%2==1 then m[x][y]=2 end end end pX,pY=6,6 dX,dY=1,0 lX, lY=0,0.66 t=0 cs=cos(0.05)sn=sin(0.05)function update()s=0 if btn(82)then s=0.1 elseif btn(81)then s=-0.1 end if s~=0 then pX,pY=pX+dX*s,pY+dY*s end s=0 if btn(80)then s=1 elseif btn(79)then s=-1 end if s~=0 then dX,dY=dX*cs+dY*sn*s,dY*cs- dX*sn*s lX,lY=lX*cs+lY*sn*s,lY*cs-lX*sn*s end cls()for x=0, 39 do cX=2*x/40-1 rx,ry=dX+lX*cX,dY+lY*cX mX=flr(pX)mY=flr( pY)eX=abs(1/rx)eY=abs(1/ry)tX=sgn(rx)sX=eX*tX*(mX-pX+((tX+1 )>>1))tY=sgn(ry)sY=eY*tY*(mY-pY+((tY+1)>>1))while 1 do if sX0 then break end end p=(d==0)and(sX-eX)or( sY-eY)ink(m[mX][mY])for y=max(0,15-15/p),min(30,15+15/p)do print(d==0 and "\143" or "\207",x,y)end end end