maze(6x)
๐ maze(6x) โ the XScreenSaver manual, but make it make sense
okay bestie so picture this: a program that just... makes a random maze, then solves it, on loop, forever, with graphics. That's it. That's the whole vibe. It's from the XScreenSaver manual and honestly it's giving "hypnotic screensaver that's secretly a whole algorithms lecture" โจ
โจ NAME โจ
maze โ an automated X11 demo that repeatedly creates and solves a random maze ๐๐
๐ SYNOPSIS ๐
maze [--display host:display.screen] [--foreground color] [--background
color] [--window] [--root] [--window-id number][--install] [--visual
visual] [--grid-size pixels] [--live-color color] [--dead-color color]
[--solve-delay usecs] [--pre-delay usecs] [--post-delay usecs]
[--generator integer] [--max-length integer] [--fps]
(no cap, the spacing in [--window-id number][--install] and the line breaks are exactly how it ships โ iconique formatting choices, we respect them ๐ซถ)
๐ธ DESCRIPTION ๐ธ
So the maze program creates a "random" maze, and then it solves it, and you get to watch the whole thing happen with graphical feedback. That's the tea. ๐
Lowkey mesmerizing. Highkey a screensaver. Periodt.
๐ OPTIONS ๐
maze accepts the following options:
--windowโ draw on a newly-created window. This is the default, bestie, so if you do nothing you still get a window ๐ช--rootโ draw on the root window instead.--window-id numberโ draw on the specified window. Very "I know a guy" energy.--installโ install a private colormap for the window ๐จ--visual visualโ specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual.--grid-size pixelsโ the size of each block of the maze, in pixels. Default is0, which means "pick a random grid size" ๐ฒ. Minimum meaningful value is2.--live-color colorโ the color of the path. the path!! the main character!! ๐--dead-color colorโ the color of the failed path. It is also stippled with a 50% pattern. (rip to that path, it tried ๐)--skip-color colorโ the maze solver will choose to not go down a path if it can "see" (in a straight line) that it is a dead end. This is the color to use for paths that are skipped for this reason. clairvoyant solver behavior, we love a queen who plans ahead ๐ฎ--surround-color colorโ if the maze solver ever completely encloses an area within the maze, then it knows that the exit is not in there (and in fact the interior of that area might not even be reachable). It will mark out those cells using this color.--solve-delay integerโ delay (in microseconds) between each step of the solution path. Default5000, or about 1/200th second. โฑ๏ธ--pre-delay integerโ delay (in microseconds) between generating a maze and starting to solve it. Default2000000(2 seconds).--post-delay integerโ delay (in microseconds) after solving a maze and before generating a new one. Default4000000(4 seconds).--generator numโ sets the algorithm that will be used to generate the mazes. The default is-1, which randomly selects an algorithm for each maze that is generated.- Generator
0is the original one, and works by walking around randomly until we hit a place we've been before, then backtracking and trying a new direction somewhere. - Generator
1picks a random spot in the maze, then draws a straight wall from that spot in a random direction until it hits another wall (and continues until the maze is complete). - Generator
2is based on sets. Initially all cells are in different sets. Then two neighboring cells are chosen and if they are in different sets, their sets are joined. If they were in the same set, a wall is built between them. This continues until the maze is complete.
- Generator
All generators generate mazes with a certain 'characteristic'. See if you can spot them! ๐โจ
The three algorithms are essentially Kruskal, Prim, and a depth-first recursive backtracker. (yes bestie, the screensaver is doing real computer science, we stan an intellectual ๐ง ๐)
--max-length numโ controls the maximum length of walls drawn in one go by generator1.--fpsโ display the current frame rate and CPU load ๐
๐ฑ๏ธ mouse controls ๐ฑ๏ธ
Clicking the mouse in the maze window controls it. Literally just click. Go off.
LeftButtonโ clears the window and restarts maze. ๐MiddleButtonโ pause or unpause the program. โธ๏ธRightButtonโ exit. bye bestie ๐
๐ BUGS ๐
- Expose events force a restart of maze. (not a vibe, but it's canon ๐ญ)
- Mouse actions are based on "raw" values (
Button1,Button2andButton3) instead of using the pointer map. (it said "no remapping, I don't know her" ๐)
๐ ENVIRONMENT ๐
DISPLAYโ to get the default host and display number.XENVIRONMENTโ to get the name of a resource file that overrides the global resources stored in theRESOURCE_MANAGERproperty.XSCREENSAVER_WINDOWโ the window ID to use with--root.
๐ฆ SEE ALSO ๐ฆ
X(1), xscreensaver(1) โ go read those too, iykyk ๐
โญ COPYRIGHT โญ
Copyright ยฉ 1988 by Sun Microsystems, Inc. Mountain View, CA.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Sun or MIT not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. Sun and M.I.T. make no representations about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty.
๐ธ okay legal-bestie moment, listen up, this one's serious (the caps are theirs, not mine): SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
๐ง AUTHOR(s) ๐ง
The literal legends who made this happen:
- Zack Weinberg [ Smarter maze-solver ]
zack@rabi.phys.columbia.edu - Johannes Keukelaar [ Generators 1 and 2 ]
johannes@nada.kth.se- Royal Institute of Technology, Stockholm, Sweden
- Jim Randell [ XScreenSaver version ]
jmr@mddjmr.fc.hp.com- HPLabs, Bristol
- Richard Hess [ X11 extensions ]
{...}!uunet!cimshop!rhess- Consilium, Mountain View, CA
- Dave Lemke [ X11 version ]
lemke@sun.COM- Sun MicroSystems, Mountain View, CA
- Martin Weiss [ SunView version ]
- Sun MicroSystems, Mountain View, CA
and that's the whole page babes ๐ this was X Version 11, 6.09, dated 07-Jun-2024 โ screenshot it, cite it, cite me, mwah ๐ซถโจ๐
๐ฆ where this page comes from
- debian trixie: xscreensaver-data-extra 6.09+dfsg1-1 ยท Other_1
- opensuse-leap 16.0: xscreensaver-data-extra 6.09-bp160.1.11 ยท BSD-3-Clause AND GPL-2.0-or-later
- opensuse-leap 16.0: xscreensaver-data-extra 6.09-bp160.1.11 ยท BSD-3-Clause AND GPL-2.0-or-later
- opensuse-leap 16.0: xscreensaver-data-extra 6.09-bp160.1.11 ยท BSD-3-Clause AND GPL-2.0-or-later
- opensuse-leap 16.0: xscreensaver-data-extra 6.09-bp160.1.11 ยท BSD-3-Clause AND GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms