'Maze Generator 5 - By SierraKen - June 9, 2020.
'This Maze Generator does not calculate a solvable path to take but all or almost all of them are solvable.
'So if you give one of these maze pictures to someone else, please make sure you can solve it first.
'You can save them as .bmp pictures and/or print them on your printer.
'Freeware.
_TITLE "Maze Generator 5 - Space Bar To Make Another Maze, (S)ave, (P)rint, Esc ends." start:
IF d
= 1 THEN LINE (x
, y
)-(x
+ 10, y
), _RGB32(0, 0, 0) ELSE LINE (x
, y
)-(x
, y
+ 10), _RGB32(0, 0, 0) yy = 550
again:
LINE (xx
, 575)-(xx
+ 10, 575), _RGB32(255, 255, 255) LINE (xx2
, 575)-(xx2
+ 10, 575), _RGB32(255, 255, 255) more:
LINE (xx4
+ 1, yy4
)-(xx4
+ 9, yy4
), _RGB32(255, 255, 255) more2:
LINE (xx5
, yy5
+ 1)-(xx5
, yy5
+ 9), _RGB32(255, 255, 255)
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)