Amazing [pun not intended, sorry] that something coherent can be generated through such absurdly simple, random code...
Originally shared by Norbert Landsteiner
I Declare Maze Day
Many amazing maze programs have been written for computers of all bread and kind, but, for some reason, there's no international Maze Day (while a few educational institutions in the US do have one of their own).
Here's one example, a quite famous BASIC one-liner for Commodore 8-bit computers generating a maze from just two characters ("\" and "/"):
10 PRINT CHR$(205.5+RND(1));: GOTO 10
Try it online: http://www.masswerk.at/pet/?run=maze
What may be a suitable date for Maze Day?
Do you remember any maze algorithms in particular?
Sister blog of Physicists of the Caribbean in which I babble about non-astronomy stuff, because everyone needs a hobby
Subscribe to:
Post Comments (Atom)
Review : Pagan Britain
Having read a good chunk of the original stories, I turn away slightly from mythological themes and back to something more academical : the ...
-
"To claim that you are being discriminated against because you have lost your right to discriminate against others shows a gross lack o...
-
I've noticed that some people care deeply about the truth, but come up with batshit crazy statements. And I've caught myself rationa...
-
For all that I know the Universe is under no obligation to make intuitive sense, I still don't like quantum mechanics. Just because some...
Python:
ReplyDeleteimport random, sys
while True: sys.stdout.write(random.choice(u"╱╲"))
Python3:
import random
while True: print(random.choice(u"╱╲"), end='')
Other characters that work well
fileformat.info - Unicode Characters in the Box Drawing Block
The code doesn't guarantee a solution path through the maze.
ReplyDeleteThat's debatable. Generate a large enough maze and select a small enough area and you'll definitely have something with a navigable route. What it doesn't do is guarantee a solution within a fixed area.
ReplyDeletehttps://lh3.googleusercontent.com/OOocaQB0CvT6AHenEQJBFZcQdAh048RUtnTnDWBPKlbk2e07uUKiDuqPUJH_6e6bsotH_xxScnRlkv9E1DzHSoSFjqO0MQzwOqQi=s0
ReplyDeleteI thought that font looked familiar...
ReplyDeleteI guess that depends on what one takes the entrance and exit definition to be. Left to right edges?
ReplyDelete