Michael Chaney Posted March 12, 2020 Share Posted March 12, 2020 Years ago, in the early 1980s, I recall typing in a simple maze generator from a magazine article. It wasn't the one in Compute's book of TI games. It used character definitions to create 16 different cell types, and so the entire maze was 28x24. I cannot find it. Does anybody remember this? Quote Link to comment Share on other sites More sharing options...
Ed in SoDak Posted March 14, 2020 Share Posted March 14, 2020 Welcome! Where all did you look? That's a broad base of possibilities, excluding only Compute's book. Like you, my magazine program transcribing days took place over 30 years ago. Back then I'd buy any magazine rack title that had even a short column mentioning TI. Most any electronics title was flirting with computers and publishing listings for multiple systems, besides the ones specific to computers or dedicated to promoting one brand or another. And of course subscriber publications like Micropendium and user group newsletters not found on a newstand or magazine rack. Many programs and complete disks-full have been preserved on WHT, Gamebase and elsewhere. The program's name might not even have "Maze" in it, at the whim of the author or whoever typed it in and later archived it online. I've downloaded many megs of 'em, but admit to only checking out a few dozen at best. Need more info to narrow it down! What mags did you buy or read back then? Was it written in Console Basic, Extended Basic cartridge? -Ed 1 Quote Link to comment Share on other sites More sharing options...
matthew180 Posted March 17, 2020 Share Posted March 17, 2020 I'm like mazes and maze generation quite a bit. The first maze generator I even encountered was from a COMPUTE! magazine, IIRC. I spent a lot of time taking that code apart, and it was probably my first exposure to an actual algorithm. I now know it was a recursive-decent generator, and to save memory (it was written in BASIC after all) it used the screen as the stack by skipping every other cell during generation, which allows the path itself to be used during back-tracking. This also means mazes always had a full tile between paths, which it not necessarily a bad characteristic and could probably come in handy. It does limit the complexity of the maze in a given size though. It was slow though. I have never found a maze algorithm that runs quickly in TI-BASIC or XB. On 3/11/2020 at 9:55 PM, Michael Chaney said: ... a simple maze generator ... ... It used character definitions to create 16 different cell types ... That does not sound particularly simple, unless the 16 different types were such that you could randomly select any of them and have it fit anywhere. As Ed mentioned, more info is needed to narrow this down, but I hope you find it; I'm interested to know more about the method used to generate the maze. Make sure you check the Internet Archive's computer magazine section, they have full scans of most of the home computer magazines from back in the day. I will also try to find the one I first learned about years ago. Quote Link to comment Share on other sites More sharing options...
fimbulvetr Posted March 17, 2020 Share Posted March 17, 2020 Page 33, Volume 1 No. 4 of 99’er magazine has a type-in game called Maze Race that randomly generates a maze. Quote Link to comment Share on other sites More sharing options...
Asmusr Posted March 17, 2020 Share Posted March 17, 2020 On 3/12/2020 at 5:55 AM, Michael Chaney said: It used character definitions to create 16 different cell types Perhaps 16 patterns with 4x4 pixels blocks, like multicolor mode? Quote Link to comment Share on other sites More sharing options...
matthew180 Posted March 17, 2020 Share Posted March 17, 2020 (edited) A quick search in the COMPUTE! archive for "maze" gave some results: Dec 1981, Issue 19, pg 54. Maze Generator Jul 1982, Issue 26, pg 40. Maze Race, references and uses Maze Generator Dec 1982, Issue 31, pg 152. Hidden Maze, references and uses Maze Generator The first article certainly appears to use the algorithm I remember, however it is too early for me to have read; I did not discover computer magazines until early 1983. I suppose it is possible that the last one might have crossed my path though. Were there any other main-stream magazines of the time publishing type-in BASIC programs? In looking through a few different publications, clearly COMPUTE! was the primary source, but in my vague memories it seems like there were "so many" others (probably false memories). Edited March 17, 2020 by matthew180 Quote Link to comment Share on other sites More sharing options...
matthew180 Posted March 18, 2020 Share Posted March 18, 2020 A few more articles (by the same author) in Creative Computing: Creative Computing, June 1981, Bee Amazed Creative Computing, Dec 1982, Pocket Computing Fun Creative Computing, Dec 1983, PolyMaze Solver Quote Link to comment Share on other sites More sharing options...
majestyx Posted March 18, 2020 Share Posted March 18, 2020 Family Computing (from Scholastic) published some TI program listings along with their kids-oriented sister publication K-Power. There was a game call Amazin' in a K-Power compilation special, but I don't think this is the program you're seeking. Just wanted to note that those two publications also had substantial TI listings in them. https://archive.org/details/family-computing https://archive.org/details/k-power-magazine 1 Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted March 18, 2020 Share Posted March 18, 2020 It sounds familiar... I'm not sure I've seen a printed magazine listing for the TI using the technique though. What it's doing is using a nybble value (0-15) to indicate open or closed spaces on the four sides of the cell. So if it was NSEW and you wanted walls on the north and east side, it would be 1010, or value 10. The maze generator in Wizard's Doom uses this technique as it's very efficient in terms of storing the maze. If it was written in BASIC though, that's impressive because you'd have to use adds instead of bitwise operations, which are only available in XB. Quote Link to comment Share on other sites More sharing options...
Michael Chaney Posted March 21, 2020 Author Share Posted March 21, 2020 (edited) First, thanks for all the replies! I should have mentioned a few things: 1. I've searched extensively through online magazine archives. The program that I'm seeking was TI-specific (it used HCHAR and friends to draw the maze), although it was possibly in XBASIC. 2. It wasn't a game - it just generated the maze. It took about an hour to generate the whole screen on the TI. 3. It started at top-left and had a certain affinity for going left. The maze would start by going roughly across the top, down the right side, back across the bottom, and by then it usually had enough randomness to start being more of a maze. If I remember correctly, the algorithm just tried random directions 10 times or something like that, and then gave up and went in order checking each direction. That would cause such a pattern to emerge. 4. It seems like it was in a magazine where one wouldn't expect to find a TI program, like Byte. I might be misremembering, though. There was likewise a cool canon (music) generator one time that appeared in a magazine like that and was written specifically for the TI. I saw it, loved it, lost it, and spent years trying off and on to find it again. 5. I know *a lot* about mazes. This is me: https://github.com/mdchaney/jsmaze. That all started from the TI program nearly 40 years ago. 6. One other thing - whoever mentioned above about the 4 directions and all that - there are 16 variations of 4 walls being off/on, and it's easily stored in the low nybble and set in the character set. So 0 has no walls and 15 has all four. 14 would be the top wall open, as it's number NESW. Moving into a new cell means knocking down the wall in the current cell as well as the corresponding wall in the cell that is being entered. There's no recursion, but the only thing you really have to remember is how you entered a certain cell. That was likely done in an array. Thanks again for any help. I'm wanting to do a talk on maze generation, and you can imagine how awesome it would be to fire up a TI emulator (or, an actual TI-99/4a) and show where it all began. Edited March 21, 2020 by Michael Chaney 3 Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted March 21, 2020 Share Posted March 21, 2020 Cool algorithms! Yeah when I wrote Wizard's Doom, I had to write a maze generator myself. I didn't want it to NEVER cross it's own path, as that generates slightly boring mazes. So I use a tolerance level and it's only initially biased not to cross it's own path, but can do so on a random chance or if there's nowhere else it can go. It's not too fast, but it only takes at most ten minutes to generate the largest maze on level 6. One of my sidelined projects is a Rougelike for the TI, which will involve a much more complex procedural generating system. Not just mazes but rooms and other features. Should be fun to write when I can get to it! 1 1 Quote Link to comment Share on other sites More sharing options...
Ed in SoDak Posted March 21, 2020 Share Posted March 21, 2020 The Jim Peterson Tigercub collection has quite a few maze programs. Several with a title such as Maze Maker. Might be worth a look. -Ed 1 Quote Link to comment Share on other sites More sharing options...
matthew180 Posted March 21, 2020 Share Posted March 21, 2020 19 hours ago, Michael Chaney said: First, thanks for all the replies! ... Thanks for coming back! Nothing kills the enthusiasm for a conversation or trying to help someone like having the O.P. disappear. This is a very active and friendly community, if you post something you *will* get responses and people genuinely interested in the topic. 19 hours ago, Michael Chaney said: 2. It wasn't a game - it just generated the maze. It took about an hour to generate the whole screen on the TI. ... An HOUR? Wow, that is pretty slow even by TI-BASIC standards. So was the resulting maze at tile/character resolution, i.e. 32x24 tiles, or was it doing sub-tile pattern manipulations to make a higher resolution maze? 19 hours ago, Michael Chaney said: 3. It started at top-left and had a certain affinity for going left. ... A lot of the older algorithms would tend to do that, it makes the code easier but the result maze less random. 20 hours ago, Michael Chaney said: ... If I remember correctly, the algorithm just tried random directions 10 times or something like that, and then gave up and went in order checking each direction. ... If that is true, this could account for the long generation time. TI-BASIC is not fast at making random numbers. That also seems like a bad design based on some idea that in 10 random rolls you will try each direction. There are better and faster ways. 20 hours ago, Michael Chaney said: ... I saw it, loved it, lost it, and spent years trying off and on to find it again. I know that experience well. We will find it though! ? 20 hours ago, Michael Chaney said: 5. I know *a lot* about mazes. This is me: https://github.com/mdchaney/jsmaze. That all started from the TI program nearly 40 years ago. Cool, I'll have to check out your repo. My interest in mazes and maze generation was also sparked by a program (I mentioned the story above) that I found in a magazine BITD. 13-year-old me was fascinated, and I still like maze generation today. I assume you know about the Think Labyrinth website: http://www.astrolog.org/labyrnth.htm Lots of great stuff there. There are also a lot of generators on the 'net for things like dungeon generators and such, which are related to mazes but have other features like rooms, connecting paths, etc. There was a guy, Jamis Buck, who had some nice generators and such, but it all disappeared one day. Then a year or so later he had a book about mazes on Amazon (which answered why he took down all his stuff from the 'net). The book is "ok" (I own it), but his webpages and such were better IMO. The book does not provide any info you probably don't already know, i.e. he didn't seem to come up with anything new for the book over what he had previously put online. 20 hours ago, Michael Chaney said: 6. One other thing - whoever mentioned above about the 4 directions and all that - there are 16 variations of 4 walls being off/on, and it's easily stored in the low nybble and set in the character set. So 0 has no walls and 15 has all four. 14 would be the top wall open, as it's number NESW. Moving into a new cell means knocking down the wall in the current cell as well as the corresponding wall in the cell that is being entered. ... Yup, that is a common pattern that I think most programmers discover on their own if they spend any time working with maze generation. I did, then noticed a lot of other implementations also used some variation of that exact method. It is more compact for sure, but takes more processing to manage the bit manipulations, so there is always a trade-off. On a modern computer where a few bytes of memory is of little concern, it is easier and faster to just have a variable for each wall in your cell-structure. Then again, if you don't consider each cell as a room with walls, then that whole pattern goes away. For example, instead of managing cells you can think of a maze as just a bunch of walls, which implicitly create rooms. There are lots of different models for mazes, which keeps it fun and interesting, IMO. 20 hours ago, Michael Chaney said: I'm wanting to do a talk on maze generation, and you can imagine how awesome it would be to fire up a TI emulator (or, an actual TI-99/4a) and show where it all began. Cool. Please post info if this happens. 14 hours ago, adamantyr said: So I use a tolerance level and it's only initially biased not to cross it's own path, but can do so on a random chance or if there's nowhere else it can go. Most dungeon generators I have looked at generate the perfect maze first, then go back and knock down walls to create loops, rooms, wider openings, etc. Seems easier to have a multi-stage process like that over complicating the generation algorithm; and it might help speed things up on something like a retro-computer. Quote Link to comment Share on other sites More sharing options...
merlins_ghost Posted August 17, 2020 Share Posted August 17, 2020 Check here https://rosettacode.org/wiki/Maze_generation it is not exactly what you are looking for though. At the link there are many various maze generators. "How to Build a Maze," Byte magazine, Dec. 1981 by David Matuszek described a maze generator using 0-15 for the cells of the maze, using -1 for frontier cells, and some other number eg. 100 for the wall cells. Nibble magazine Feb 1984 by David Krathwohl "Speed Maze" contained a maze generator using the aforementioned article as a template. Maybe not much help, but maybe you can find articles written by one of them for TI-99/4A. Quote Link to comment Share on other sites More sharing options...
+TheBF Posted August 17, 2020 Share Posted August 17, 2020 For fun I took the Commodore BASIC version from Rosetta Code and got it to run under TI XB. The 32 column screen is too narrow but it does output a maze. I just changed the DIM statements to use literal numbers and made RND correct for TI-99 It needs more work to make it function on the TI-99 BASIC screen but it's a beginning for someone. Spoiler 1 REM MAZE from Rosetta CODE 2 REM Adapted from commodore BASIC 100 MS=10::REM MAZE SIZE 101 REM changed (MS+1,MS+1) 110 DIM S(11,11)::REM south walls 120 DIM W(11,11)::REM west walls 130 DIM V(11,11)::REM visited cells 140 PRINT "INITIALIZING..." 150 GOSUB 260::REM initialize maze 160 PRINT "BUILDING..." 161 REM Changed from PC((MS*MS)+1) PR((MS*MS)+1) 170 DIM PC(101)::DIM PR(101)::REM STACK 180 REM PICK RANDOM STARTING CELL 190 X = RND*MS 200 C=(INT(RND*MS)+1) 210 R=(INT(RND*MS)+1) 220 GOSUB 400::REM BUILD MAZE 230 GOSUB 540::REM DRAW MAZE 240 END 250 REM -----INITIALIZE MAZE----- 260 REM SET WALLS ON AND VISITED CELLS OFF 270 T=MS+1 280 FOR C=0 TO T::FOR R=0 TO T:: 290 S(C,R)=1 291 W(C,R)=1 292 V(C,R)=0 300 NEXT R 301 NEXT C 310 REM SET BORDER CELLS TO VISITED 320 FOR C=0 TO T 330 V(C,0)=1::V(C,T)=1 340 NEXT C 350 FOR R=0 TO T 360 V(0,R)=1::V(T,R)=1 370 NEXT R 380 RETURN 390 REM -----BUILD MAZE----- 400 U=U+1::PC(U)=C::PR(U)=R::REM PUSH 410 V(C,R)=1 420 IF V(C,R+1)=1 AND V(C+1,R)=1 AND V(C,R-1)=1 AND V(C-1,R)=1 THEN GOTO 500 430 Z=INT(RND*4) 440 IF Z=0 AND V(C,R+1)=0 THEN S(C,R)=0::R=R+1::GOTO 400 450 IF Z=1 AND V(C+1,R)=0 THEN W(C+1,R)=0::C=C+1::GOTO 400 460 IF Z=2 AND V(C,R-1)=0 THEN S(C,R-1)=0::R=R-1::GOTO 400 470 IF Z=3 AND V(C-1,R)=0 THEN W(C,R)=0::C=C-1::GOTO 400 480 GOTO 430 500 C=PC(U)::R=PR(U)::U=U-1::REM POP 510 IF U > 0 THEN GOTO 420 520 RETURN 530 REM -----DRAW MAZE----- 540 REM OPEN #1: RS232.BA=9600 550 PRINT "+--+--+--+--+--+--+--+--+--+--+" 560 FOR R = 1 TO MS 570 FOR C = 1 TO MS+1 580 IF W(C,R)=0 THEN PRINT " "; 590 IF W(C,R)=1 THEN PRINT ": "; 600 NEXT C 610 PRINT 620 FOR C = 1 TO MS 630 IF S(C,R)=0 THEN PRINT "+ "; 640 IF S(C,R)=1 THEN PRINT "+--"; 650 NEXT C 660 PRINT "+" 670 NEXT R 680 REM CLOSE #1 ::REM close printer device 690 RETURN Quote Link to comment Share on other sites More sharing options...
Jim Davis Posted October 5, 2020 Share Posted October 5, 2020 (edited) On 3/20/2020 at 7:18 PM, Michael Chaney said: 4. It seems like it was in a magazine where one wouldn't expect to find a TI program, like Byte. I might be misremembering, though. There was likewise a cool canon (music) generator one time that appeared in a magazine like that and was written specifically for the TI. I saw it, loved it, lost it, and spent years trying off and on to find it again. Not the maze part, but I think I found the music! Enter magazine, April 1985, "Pocket Canon." (I found your post here while looking for the program myself.) Edited October 5, 2020 by Jim Davis 4 Quote Link to comment Share on other sites More sharing options...
Ed in SoDak Posted October 6, 2020 Share Posted October 6, 2020 12 hours ago, Jim Davis said: Enter magazine, April 1985 Welcome and thanks for unearthing another "pocket" program. I remember typing in Pocket Sunrise and a few others. Don't recall seeing Enter magazine though. Usually if I saw they had a TI99 "anything" in their pages, I'd buy it off the periodicals rack. Off to archive.org! -Ed 1 Quote Link to comment Share on other sites More sharing options...
Michael Chaney Posted March 9, 2022 Author Share Posted March 9, 2022 On 10/5/2020 at 9:41 AM, Jim Davis said: Not the maze part, but I think I found the music! Enter magazine, April 1985, "Pocket Canon." (I found your post here while looking for the program myself.) This. Is. So. Cool!!! The utter simplicity of the pocket canon program is why I remember it. Thank you for this. I'm still looking for the maze, but at this point I think I probably took the maze program that is in the Compute! book and made it into what I remember. It's been 40 years, time flies when you're having fun! Quote Link to comment Share on other sites More sharing options...
Reciprocating Bill Posted March 9, 2022 Share Posted March 9, 2022 Rosetta Code has a lot of maze generation/maze solving code. One example is in Commodore BASIC, which I converted into assembly on the TI (I find conversion into assembly from BASIC easiest, as neither has any structure to speak of). It utilizes Graphics I (and one sprite), but only redefines four characters to display the maze and display the solution. This console has 16-bit RAM built-in. Maze.mov 1 Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted March 9, 2022 Share Posted March 9, 2022 I seem to remember there was a maze generator in one of the later 99er magazines as well, it may have even been after the name switch to Home Computer Magazine in 1984. I remember typing the Pocket Sunrise program into my machine BITD too. . . 1 Quote Link to comment Share on other sites More sharing options...
+Schmitzi Posted March 24, 2022 Share Posted March 24, 2022 With WEB99, I found (with one click ) the XB Maze Generator from John Behnke Maybe this is it ? Spoiler 100 !@ MAZE BY JOHN BEHNKE 110 !@ X-BASIC + 32K 120 CALL CLEAR :: DIM A(320,2),B(144),C(320,2),D(144):: DIM E(144),A$(60,42):: DISPLAY AT(1,8):"MAZE GENERATOR":"----------------------------" 130 DISPLAY AT(6,1):"WIDTH OF MAZE? (2-20) : 9" :: ACCEPT AT(6,27)VALIDATE(DIGIT)BEEP SIZE(-2):F :: DISPLAY AT(8,1):"LENGTH OF MAZE? (2-20) : 11" :: ACCEPT AT(8,27)VALIDATE(DIGIT)BEEP SIZE(-2):G 140 IF F<2 OR F>20 OR G<2 OR G>20 THEN 130 150 DISPLAY AT(10,1):"SCREEN OR PRINTER? (S/P) : S" :: ACCEPT AT(10,28)VALIDATE("SP")BEEP SIZE(-1):B$ :: IF B$="P" THEN 180 160 IF B$="S" AND F<10 AND G<12 THEN 180 170 DISPLAY AT(22,1)BEEP:"MAZE WILL NOT FIT ON SCREEN" :: FOR H=1 TO 400 :: NEXT H :: DISPLAY AT(22,1):"" :: GOTO 130 180 RANDOMIZE :: IF B$="S" THEN 200 190 DISPLAY AT(12,1):"DEVICE NAME: PIO" :: ACCEPT AT(12,14)BEEP SIZE(-15):C$ 200 I=F*G-1 :: IF (G*2)*(F*3)>925 THEN GOSUB 470 :: GOTO 130 210 DISPLAY AT(22,1)BEEP:" INITIALIZING THE MAZE" :: GOSUB 250 :: DISPLAY AT(22,1)BEEP:" CREATING THE MAZE" :: GOSUB 280 :: DISPLAY AT(22,1)BEEP:" INITIALIZING PRINTOUT" :: GOSUB 370 220 PRINT " PRESS <ENTER> FOR ANOTHER" 230 CALL KEY(0,J,K):: IF K=0 THEN 230 240 IF J=13 THEN RUN ELSE CALL CLEAR :: END 250 REM 260 L=0 :: M=G*(F-1)-1 :: N=0 :: FOR O=1 TO G :: FOR P=1 TO F-1 :: DISPLAY AT(24,10):USING "###.## %":L/M*100 :: L=L+1 :: A(L,1)=N :: A(L,2)=N+1 :: N=N+1 :: NEXT P :: N=N+1 :: NEXT O :: FOR N=0 TO I-F 270 L=L+1 :: A(L,1)=N :: A(L,2)=N+F :: NEXT N :: M=L :: RETURN 280 REM 290 FOR H=0 TO I :: B(H)=H :: E(H)=H :: D(H)=1 :: NEXT H :: Q=0 300 IF L<=0 THEN 360 310 DISPLAY AT(24,10):USING "###.## %":(M-L+1)/M*100 :: R=INT(RND*L)+1 :: S=A(R,1):: T=A(R,2):: U=B(S):: V=B(T):: IF U=V THEN 350 320 Q=Q+1 :: C(Q,1)=S :: C(Q,2)=T :: IF D(U)>D(V)THEN W=U :: X=V ELSE W=V :: X=U 330 Y=W :: IF U=X THEN Z=S :: AA=T ELSE Z=T :: AA=S 340 B(Z)=Y :: FOR H=1 TO D(X)-1 :: Z=E(Z):: B(Z)=Y :: NEXT H :: BA=E(Z):: E(Z)=E(AA):: E(AA)=BA :: D(W)=D(U)+D(V) 350 A(R,1)=A(L,1):: A(R,2)=A(L,2):: L=L-1 :: IF L>0 THEN 300 360 RETURN 370 REM 380 FOR CA=0 TO G :: A$(0,2*CA)="+" :: FOR H=1 TO F :: A$(3*H-2,2*CA)="-" :: A$(3*H-1,2*CA)="-" :: A$(3*H,2*CA)="+" :: NEXT H :: NEXT CA :: FOR CA=1 TO G :: A$(0,2*CA-1)="|" :: FOR H=1 TO F 390 A$(3*H-2,2*CA-1)=" " :: A$(3*H-1,2*CA-1)=" " :: A$(3*H,2*CA-1)="|" :: NEXT H :: NEXT CA :: FOR J=1 TO Q :: IF C(J,1)<C(J,2)THEN 410 400 DA=C(J,1):: C(J,1)=C(J,2):: C(J,2)=DA 410 H=(C(J,1)/F-INT(C(J,1)/F))*F+1 :: CA=INT(C(J,1)/F)+1 :: DISPLAY AT(24,10):USING "###.## %":J/Q*100 420 IF C(J,1)=C(J,2)-F THEN A$(3*H-2,2*CA)=" " :: A$(3*H-1,2*CA)=" " ELSE A$(3*H,2*CA-1)=" " 430 NEXT J :: IF B$="P" THEN 460 440 FOR CA=0 TO 2*G :: FOR H=0 TO 3*F :: PRINT A$(H,CA);:: NEXT H :: PRINT :: NEXT CA 450 RETURN 460 OPEN #1:C$ :: FOR CA=0 TO 2*G :: FOR H=0 TO 3*F :: PRINT #1:A$(H,CA);:: NEXT H :: PRINT #1 :: NEXT CA :: CLOSE #1 :: GOTO 450 470 DISPLAY AT(22,1)BEEP:" NOT ENOUGH MEMORY" :: FOR H=1 TO 400 :: NEXT H :: DISPLAY AT(22,1):"" :: RETURN 1 Quote Link to comment Share on other sites More sharing options...
Michael Chaney Posted March 27, 2022 Author Share Posted March 27, 2022 On 3/24/2022 at 4:55 PM, Schmitzi said: With WEB99, I found (with one click ) the XB Maze Generator from John Behnke Maybe this is it ? Reveal hidden contents 100 !@ MAZE BY JOHN BEHNKE 110 !@ X-BASIC + 32K 120 CALL CLEAR :: DIM A(320,2),B(144),C(320,2),D(144):: DIM E(144),A$(60,42):: DISPLAY AT(1,8):"MAZE GENERATOR":"----------------------------" 130 DISPLAY AT(6,1):"WIDTH OF MAZE? (2-20) : 9" :: ACCEPT AT(6,27)VALIDATE(DIGIT)BEEP SIZE(-2):F :: DISPLAY AT(8,1):"LENGTH OF MAZE? (2-20) : 11" :: ACCEPT AT(8,27)VALIDATE(DIGIT)BEEP SIZE(-2):G 140 IF F<2 OR F>20 OR G<2 OR G>20 THEN 130 150 DISPLAY AT(10,1):"SCREEN OR PRINTER? (S/P) : S" :: ACCEPT AT(10,28)VALIDATE("SP")BEEP SIZE(-1):B$ :: IF B$="P" THEN 180 160 IF B$="S" AND F<10 AND G<12 THEN 180 170 DISPLAY AT(22,1)BEEP:"MAZE WILL NOT FIT ON SCREEN" :: FOR H=1 TO 400 :: NEXT H :: DISPLAY AT(22,1):"" :: GOTO 130 180 RANDOMIZE :: IF B$="S" THEN 200 190 DISPLAY AT(12,1):"DEVICE NAME: PIO" :: ACCEPT AT(12,14)BEEP SIZE(-15):C$ 200 I=F*G-1 :: IF (G*2)*(F*3)>925 THEN GOSUB 470 :: GOTO 130 210 DISPLAY AT(22,1)BEEP:" INITIALIZING THE MAZE" :: GOSUB 250 :: DISPLAY AT(22,1)BEEP:" CREATING THE MAZE" :: GOSUB 280 :: DISPLAY AT(22,1)BEEP:" INITIALIZING PRINTOUT" :: GOSUB 370 220 PRINT " PRESS <ENTER> FOR ANOTHER" 230 CALL KEY(0,J,K):: IF K=0 THEN 230 240 IF J=13 THEN RUN ELSE CALL CLEAR :: END 250 REM 260 L=0 :: M=G*(F-1)-1 :: N=0 :: FOR O=1 TO G :: FOR P=1 TO F-1 :: DISPLAY AT(24,10):USING "###.## %":L/M*100 :: L=L+1 :: A(L,1)=N :: A(L,2)=N+1 :: N=N+1 :: NEXT P :: N=N+1 :: NEXT O :: FOR N=0 TO I-F 270 L=L+1 :: A(L,1)=N :: A(L,2)=N+F :: NEXT N :: M=L :: RETURN 280 REM 290 FOR H=0 TO I :: B(H)=H :: E(H)=H :: D(H)=1 :: NEXT H :: Q=0 300 IF L<=0 THEN 360 310 DISPLAY AT(24,10):USING "###.## %":(M-L+1)/M*100 :: R=INT(RND*L)+1 :: S=A(R,1):: T=A(R,2):: U=B(S):: V=B(T):: IF U=V THEN 350 320 Q=Q+1 :: C(Q,1)=S :: C(Q,2)=T :: IF D(U)>D(V)THEN W=U :: X=V ELSE W=V :: X=U 330 Y=W :: IF U=X THEN Z=S :: AA=T ELSE Z=T :: AA=S 340 B(Z)=Y :: FOR H=1 TO D(X)-1 :: Z=E(Z):: B(Z)=Y :: NEXT H :: BA=E(Z):: E(Z)=E(AA):: E(AA)=BA :: D(W)=D(U)+D(V) 350 A(R,1)=A(L,1):: A(R,2)=A(L,2):: L=L-1 :: IF L>0 THEN 300 360 RETURN 370 REM 380 FOR CA=0 TO G :: A$(0,2*CA)="+" :: FOR H=1 TO F :: A$(3*H-2,2*CA)="-" :: A$(3*H-1,2*CA)="-" :: A$(3*H,2*CA)="+" :: NEXT H :: NEXT CA :: FOR CA=1 TO G :: A$(0,2*CA-1)="|" :: FOR H=1 TO F 390 A$(3*H-2,2*CA-1)=" " :: A$(3*H-1,2*CA-1)=" " :: A$(3*H,2*CA-1)="|" :: NEXT H :: NEXT CA :: FOR J=1 TO Q :: IF C(J,1)<C(J,2)THEN 410 400 DA=C(J,1):: C(J,1)=C(J,2):: C(J,2)=DA 410 H=(C(J,1)/F-INT(C(J,1)/F))*F+1 :: CA=INT(C(J,1)/F)+1 :: DISPLAY AT(24,10):USING "###.## %":J/Q*100 420 IF C(J,1)=C(J,2)-F THEN A$(3*H-2,2*CA)=" " :: A$(3*H-1,2*CA)=" " ELSE A$(3*H,2*CA-1)=" " 430 NEXT J :: IF B$="P" THEN 460 440 FOR CA=0 TO 2*G :: FOR H=0 TO 3*F :: PRINT A$(H,CA);:: NEXT H :: PRINT :: NEXT CA 450 RETURN 460 OPEN #1:C$ :: FOR CA=0 TO 2*G :: FOR H=0 TO 3*F :: PRINT #1:A$(H,CA);:: NEXT H :: PRINT #1 :: NEXT CA :: CLOSE #1 :: GOTO 450 470 DISPLAY AT(22,1)BEEP:" NOT ENOUGH MEMORY" :: FOR H=1 TO 400 :: NEXT H :: DISPLAY AT(22,1):"" :: RETURN No that isn't it. It was written in straight basic as I recall. I don't even think I had xb at the time. 1 Quote Link to comment Share on other sites More sharing options...
+dhe Posted May 16, 2022 Share Posted May 16, 2022 On 8/17/2020 at 4:29 PM, TheBF said: The 32 column screen is too narrow but it does output a maze. ABASIC 408. 2 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted May 17, 2022 Share Posted May 17, 2022 (edited) No entry, no exit. It's not a maze, it's a confusing prison! Edited May 17, 2022 by apersson850 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted May 17, 2022 Share Posted May 17, 2022 1 hour ago, apersson850 said: No entry, no exit. It's not a maze, it's a confusing prison! But, it's always ready Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.