Author Topic: Maze  (Read 2457 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 319
  • Karma: 25
  • Hard players don't go home.
    • View Profile
Maze
« on: December 27, 2014 »
It's not a true maze, but it is a maze like pattern.

Code: [Select]
open window 640,512 rem >.
blox=800
dim x(blox)
dim y(blox)
dim r(blox)
for a=1 to blox
r(a)=ran(4) rem or 3 or 2
next a
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
for a=1 to blox
xx=xx+1
if xx>32 then
xx=1
yy=yy+1
endif
if yy>25 yy=1
x(a)=xx*20
y(a)=yy*20
if r(a)<.7 line x(a),y(a) to x(a)+20,y(a)
if r(a)>.6 and r(a)<1.3 line x(a),y(a) to x(a),y(a)-20
if r(a)>1.2 and r(a)<2.9 line x(a),y(a) to x(a)-20,y(a)
if r(a)>2.8 line x(a),y(a) to x(a),y(a)+20
next a
until(1=0)
Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.