なってしまいます。
http://www.white.umic.jp/pc/files/petitcom-3ddanjon-text2.pdf
http://www.white.umic.jp/pc/files/petitcom-3ddanjon-text1.pdf
http://www.white.umic.jp/pc/files/petitcom-3ddanjon-text3.pdf
矢印キーで上下左右・終了するにはESCキーを使います。
;擬似三次元迷路 ;迷路作成 g = 14 ox=200 oy=120 dim m,16,16 ;三次元迷路の表示のための配列変数 dim wx,8 dim wy,8 dim dx,4 dim dy,4 dim lx,4 dim ly,4 dim rx,4 dim ry,4 dx(0) = 0:dy(0) = -1 dx(1) = 0:dy(1) = 1 dx(2) = -1:dy(2) = 0 dx(3) = 1:dy(3) = 0 lx(0) = -1:ly(0) = 0 lx(1) = 1:ly(1) = 0 lx(2) = 0:ly(2) = 1 lx(3) = 0:ly(3) = -1 rx(0) = 1:ry(0) = 0 rx(1) = -1:ry(1) = 0 rx(2) = 0:ry(2) = -1 rx(3) = 0:ry(3) = 1 ;外枠 for i,0,15 m(0,i) = 1 m(i,0) = 1 m(14,i) = 1 m(i,14) = 1 next ;プレイヤーの向きは最初は右 pd = 3 ;迷路を作る for y,2,14,2 for x,2,14,2 m(x,y)=1 *taosu r=rnd(4) if r=0 and y=2:x2=x:y2=y-1 if r=1:x2=x:y2=y+1 if r=2:x2=x-1:y2=y if r=3:x2=x+1:y2=y if m(x2,y2)=1:goto *taosu m(x2,y2)=1 next next ;---プレイヤーを動かす--- px = 1 py = 1 m(px,py)=2 gosub *display1 gosub *display2 repeat repeat getkey k0, 27: getkey k1,37 :getkey k2,38 :getkey k3,39 :getkey k4,40 if k0=1:goto *end_ if k2=1:pd = 0 if k4=1:pd = 1 if k1=1:pd = 2 if k3=1:pd = 3 if k2=1 and py > 1 and m(px,py-1) = 0:m(px,py) = 0:py=py-1:break if k4=1 and py < 15 and m(px,py+1) = 0:m(px,py) = 0:py=py+1:break if k1=1 and px > 1 and m(px-1,py) = 0:m(px,py) = 0:px=px-1:break if k3=1 and px < 15 and m(px+1,py) = 0:m(px,py) = 0:px=px+1:break await(8) loop m(px,py)=2 gosub *display1 gosub *display2 repeat getkey k1,37 :getkey k2,38 :getkey k3,39 :getkey k4,40 if k1=0 and k2=0 and k3=0 and k4=0:break await(8) loop await(8) loop *end_ end *display1 cls 0 for y,0,16,1 for x,0,16,1 if m(x,y)=1:pos x*g+400,y*g:mes "■" if m(x,y)=2:pos x*g+400,y*g:mes "@@" next next return *display2 wx(0)=200:wy(0)=120 for n,1,7,1 wx(n)=150/(n*2-1) wy(n)=90/(n*2-1) next cx = px:cy = py for n,0,6,1 x1 = cx + lx(pd):y1 = cy + ly(pd) c1 = m(x1,y1)//ここがエラー if c1=0{ gosub *lmichi } else { gosub *lkabe } x2 = cx + rx(pd):y2 = cy + ry(pd) c2 = m(x2,y2) if c2=0{ gosub *rmichi }else{ gosub *rkabe } cx = cx + dx(pd):cy = cy + dy(pd) next return *lmichi line ox-wx(n+1), oy-wy(n+1), ox+wx(n+1), oy+wy(n+1) line ox-wx(n), oy-wy(n+1), ox-wx(n+1), oy-wy(n+1) line ox-wx(n), oy+wy(n+1), ox-wx(n+1), oy+wy(n+1) if n=0:return line ox-wx(n), oy-wy(n), ox+wx(n), oy+wy(n) return *lkabe line ox-wx(n), oy-wy(n), ox-wx(n+1), oy-wy(n+1) line ox-wx(n), oy+wy(n), ox-wx(n+1), oy+wy(n+1) return *rmichi line ox+wx(n+1), oy-wy(n+1), ox+wx(n+1), oy+wy(n+1) line ox+wx(n), oy-wy(n+1), ox+wx(n+1), oy-wy(n+1) line ox+wx(n), oy+wy(n+1), ox+wx(n+1), oy+wy(n+1) if n=0:return line ox+wx(n), oy-wy(n), ox+wx(n), oy+wy(n) return *rkabe line ox+wx(n), oy-wy(n), ox+wx(n+1), oy-wy(n+1) line ox+wx(n), oy+wy(n), ox+wx(n+1), oy+wy(n+1) return return