#! rnews 12102 From: kent@xanth.cs.odu.edu (Kent Paul Dolan) Newsgroups: comp.sources.amiga Subject: Hexagonal mazes in AmigaBASIC Message-ID: <1189@s.cc.purdue.edu> Date: 8 Oct 87 14:59:20 GMT Sender: doc@s.cc.purdue.edu Followup-To: comp.sources.amiga Organization: Purdue University Computing Center Lines: 422 Approved: doc@s.cc.purdue.edu (Craig Norborg) Posted: Thu Oct 8 09:58:56 EST 1987 Archive-Name: hexmaze.bas In response to a terrifying dearth of AmigaBASIC software, I submit the following piece of cute trivia for the USENet community. My friends claim it is fun to watch the mazes grow. My friends are mostly pretty weird. Hex_maze.bas is a program that designs hexagonal mazes on the Amiga's screen. There are 5 sizes of maze available, from a quick demo to an hours long "killer maze". The program desperately needs the AmigaBASIC Compiler ((C) by whomever). I don't own it, but I tried it on this at a friends house before I added the menus to this program, and it cut down the run time for the biggest maze from 135 minutes to about 7 minutes. Super tool! (Plug, plug! ;-) The only thing nice about this program besides the cute mazes is the maze generating algorithm. A hex grid is drawn. All of its cells are assigned to the exterior of the maze. Then a starting cell is chosen from the grid at random. It is assigned to the maze interior and the (up to) six cells around it are added to the (up to now empty) list of the boundary cells. Thereafter, a cell is chosen at random from the boundary list, moved to the maze interior, a wall is knocked out between it and (a random one of) the adjacent interior cell(s), and any adjacent exterior cells are added to the list of boundary cells. This continues until all the cells are in the interior. Then the entrance and exit are opened. So much for documentation. Here's the program. Enjoy! Kent, the man from xanth. (Kent Paul Dolan, LCDR, NOAA, Retired) ----------------------- usual clip job here ----------------------------------