'Circular Mazes
'By Sierraken on June 13, 2020. Mod B+ wall fix
begin:
_TITLE "Circular Maze Generator" PRINT " Circular Maze Generator" PRINT "This app will create random circular mazes like the kind you see using shrubs." PRINT "You can (s)ave a maze as .bmp and/or (p)rint a black and white version." 'PRINT: PRINT
'PRINT "Choose a difficulty:"
'PRINT "(1) Easy"
'PRINT "(2) Medium"
'PRINT "(3) Hard"
'PRINT
'INPUT "->"; dif
dif = 3
'INPUT "Do you want (c)olor or (b)lack and white"; c$
'IF LEFT$(c$, 1) = "c" OR LEFT$(c$, 1) = "C" THEN col = 1: GOTO start:
'IF LEFT$(c$, 1) = "b" OR LEFT$(c$, 1) = "b" THEN col = 0: GOTO start:
c$ = "b"
'GOTO begin:
start:
_TITLE "Space Bar to make new maze, (S)ave, (P)rint, Esc to quit." sz = 250
x = 400: y = 300
r2 = .25
IF dif
= 1 THEN sz
= sz
- 26.67: wsz
= 25.67 IF dif
= 2 THEN sz
= sz
- 23.33: wsz
= 22.33 IF dif
= 3 THEN sz
= sz
- 20: wsz
= 19 sz = 250
FOR wall
= 1 TO circles
- 1 sz = sz - 20
'FOR wall = 1 TO circles - 2
' go:
' xx = INT(RND * 800) + 1
' yy = INT(RND * 600) + 1
' IF col = 1 THEN cl2 = wall * 21
' IF col = 0 THEN cl2 = wall
' IF POINT(xx, yy) = _RGB32(cc, cl2, cc) THEN
' go2:
' IF xx > 400 THEN xx2 = xx - wsz: GOTO nex:
' IF xx < 400 THEN xx2 = xx + wsz
' nex:
' IF yy > 300 THEN yy2 = yy - wsz: GOTO nex2:
' IF yy < 300 THEN yy2 = yy + wsz: GOTO nex2:
' GOTO go2:
' END IF
' GOTO go:
' nex2:
' LINE (xx, yy)-(xx2, yy2), _RGB32(cc, cl2, cc)
'NEXT wall
IF sav
= 1 THEN SaveImage
0, nm$: sav
= 0 INPUT "Print on printer (Y/N)?", i$
'print screen page on printer 'printer prep (code copied and pasted from bplus Free Calendar Program)
_MAPTRIANGLE (XMAX
, 0)-(0, 0)-(0, YMAX
), 0 TO(0, 0)-(0, XMAX
)-(YMAX
, XMAX
), landscape&
_MAPTRIANGLE (XMAX
, 0)-(XMAX
, YMAX
)-(0, YMAX
), 0 TO(0, 0)-(YMAX
, 0)-(YMAX
, XMAX
), landscape&
landscape& = 0
s& = j&
saving:
PRINT " Your bmp file will be saved in the" PRINT " same directory as this program is." PRINT " It can be used with almost any" PRINT " other graphics program or website." PRINT " It is saved using:" PRINT " width: 800 height: 600 pixels." PRINT " Type a name to save your picture" PRINT " and press the Enter key. Do not" PRINT " add .bmp at the end, the program" PRINT " will do it automatically." PRINT " Quit and Enter key ends program." nm$ = nm$ + ".bmp"
'Checking to see if the file already exists on your computer.
PRINT " File Already Exists" PRINT " Saving will delete your old" PRINT " Would you like to still do it?" PRINT " Esc goes to start screen." llloop:
saving2:
sav = 1
'Here is the SUB needed to save the image to BMP.
IF bytesperpixel&
= 1 THEN bpp&
= 8 ELSE bpp&
= 24 b$
= "BM????QB64????" + MKL$(40) + MKL$(x&
) + MKL$(y&
) + MKI$(1) + MKI$(bpp&
) + MKL$(0) + "????" + STRING$(16, 0) 'partial BMP header info(???? to be filled later) FOR c&
= 0 TO 255 ' read BGR color settings from JPG image + 1 byte spacer(CHR$(0)) MID$(b$
, 11, 4) = MKL$(LEN(b$
)) ' image pixel data offset(BMP header) FOR py&
= y&
- 1 TO 0 STEP -1 ' read JPG image pixel color data r$ = ""
c&
= POINT(px&
, py&
) 'POINT 32 bit values are large LONG values d$ = d$ + r$ + padder$
MID$(b$
, 35, 4) = MKL$(LEN(d$
)) ' image size(BMP header) b$ = b$ + d$ ' total file data bytes to create file
MID$(b$
, 3, 4) = MKL$(LEN(b$
)) ' size of data file(BMP header)