Dark Bit Factory & Gravity
PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on December 27, 2014
-
It's not a true maze, but it is a maze like pattern.
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)