How Does a Single Line of BASIC Make an Intricate Maze?
JameskPratt writes "This Slate article talks about a single line of code — 10 PRINT CHR$ (205.5 + RND (1)); : GOTO 10 — and how it manages to create a complicated maze without the use of a loop, variables and without very complicated syntax." Now that amazing snippet of code is the basis of a book, and the book is freely downloadable.
It's time to start the Obfuscated BASIC contest...
http://www.ioccc.org/
What is
10 something: GOTO 10
if not an (endless) loop?
...when the summary does not know what a loop is.
No editors with programming experience perhaps.
The basic definition of a loop is a GOTO to a previous address! All the rest is syntax and optimisation.
It's very cool the way this code draws a maze, but there's obviously a loop there.
(And it's “without” not “with out”, and “complicated” not “complicate”.)
There is a thing called recursion. It's the shit.
That....is.....a loop.......
create a complicated maze with out the use of a loop
1. This is not necessarily a maze. It's noise. At best.
2. It's "without", not "with out"
3. There is a loop
0x or or snor perron?!
Re: "it manages to create a complicated maze with out the use of a loop"
We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
10 [somethong]; GOTO 10
is a loop!
Color me unimpressed. It's just randomly printing forward and backward slashes, which line up because of the font. It's nifty, but hardly amazing.
package enterprise;
/**
/**
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Collections;
import java.util.Map.Entry;
import java.util.Random;
import java.util.SortedMap;
import java.util.TreeMap;
public class Maze {
private final WallFactory<Double> wallFactory;
private final EntropyGenerator entropyGenerator;
public Maze( WallFactory<Double> wallFactory, EntropyGenerator entropyGenerator ) {
this.wallFactory = wallFactory;
this.entropyGenerator = entropyGenerator;
}
public void visit( MazeVisitor visitor ) throws MazeException {
while( true ) {
MazeWall wall = wallFactory.createMazeWall( entropyGenerator.getNewEntropyValue() );
wall.visit( visitor );
}
}
public interface MazeWall {
* @param visitor
* @throws IOException
*/
void visit( MazeVisitor visitor ) throws MazeException;
}
public static class LeftDiagonalWall implements MazeWall {
@Override
public void visit( MazeVisitor visitor ) throws MazeException {
visitor.visit( this );
}
}
public static class RightDiagonalWall implements MazeWall {
@Override
public void visit( MazeVisitor visitor ) throws MazeException {
visitor.visit( this );
}
}
public interface MazeVisitor {
void visit( LeftDiagonalWall leftDiagonalWall ) throws MazeException;
void visit( RightDiagonalWall rightDiagonalWall ) throws MazeException;
}
public interface WallFactory<T> {
* @param value
* @return the MazeWall
* @throws MazeException
*/
MazeWall createMazeWall( T value ) throws MazeException;
}
public static class StrategyWallFactory<T> implements WallFactory<T> {
private WallRepartitionStrategy<T> wallRepartitionStrategy;
public StrategyWallFactory( WallRepartitionStrategy<T> wallRepartitionStrategy ) {
this.wallRepartitionStrategy = wallRepartitionStrategy;
}
@Override
public MazeWall createMazeWall( T value ) throws MazeException {
Class<? extends MazeWall> wallClassForValue = wallRepartitionStrategy.getWallClassForValue( value );
try {
return wallClassForValue.newInstance();
} catch( InstantiationException | IllegalAccessException e ) {
throw new MazeException( "Cannot create MazeWall instance", e );
}
}
Things you think are in the Constitution, but are not.
It may not be a while(1) { ... }, but that GOTO at the end makes things functionally equivalent...
How does this not use a loop?
Don't have a Commodore Basic interpreter? this Perl 1-liner will do the same thing:
print ["/","\\"]->[rand(2)] while 1;
It has no start or end point, and for two arbitrary points you can't guarantee that a path exists.
There's a book about this? It looks like it just randomly prints either a forward slash or a backslash. The fact it appears to be a maze is just an artifact of the monospaced type. Am I missing something here?
Frontpage slashdot story with a 10 GOTO 10 and saying it's not a loop?
Dudes, just what the fuck. I ask you that.
1) It is an endless loop created by the GOTO command.
2) Is it a maze or does it just look like one? There is no indication that it actually creates a maze each and every time. It is more likely a pseudo random pattern that LOOKS like a maze.
Keep the Classic Slashdot.
Honestly, just don't.
The entire basis of the OS you are using is filled with them. Yes, Linux too.
Most of them are just contextual Gotos in the end, same thing. (in fact, there is literally some cases of actual Gotos since the other command-sensitive versions don't fit the roles)
Goto isn't evil, the developers who (ab)use it are.
Discuss.
The code selects at random one of two characters, which when printed at random may look like maze walls, and then prints them. Rince and repeat.
So basicallly it only prints garbage which was carefully selected. You get the same effect from any programming language which supports unicode, by randomly printing out unicode code points from the U+2500 - U+257f range.
... what about a solvable maze?
They're there in their room. You're on your own.
So apart from the loop from the goto then.
This article fails in English and fails in the content. Booya.
http://codeazur.com.br/stuff/fc64_final/
The impressive part of this is that they managed to fluff just one recursive rule into an entire book.
If Wolfram gets such bad reviews for stating the obvious of cellular automata after many thousands of experiments, why should we pay any attention to someone that has done just one?
It's just randomly printing forward and backward slashes, which line up because of the font. It's nifty, but hardly amazing.
And in fact, it appears Slashdot ran an article on this a decade ago when it was called DataGlyphs.
But what exactly is a maze? If you knowingly pick a valid start and end point, doesn't it become one? Isn't a maze basically a bunch of twisty lines designed to obfuscate the path from start to finish?
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
/., in collaboration with the Erowid Vault. brings you "get high and watch this code run." Wow, it's so cool.
Sent from my ENIAC
So, printing / and \ in a randomish sequence makes what looks to be a maze. Oh, and having code jump to itself is apparently not a loop. Did I miss anything?
Seriously, this is all a joke, isn't it? There is nobody back there monitoring this shit, is there?
Almost all code can be put into a single line, don't see what' amazing about that.
that's what our sensors are picking up.
It would be a maze with that additional input. Without it, it's just a bunch of squiggly lines. (Hint: choosing those points is nontrivial)
I remember doing that in 1980something on the PET (maybe not that line, but the logic was the same). IIRC it was a type-in along with a bunch of other cheap BASIC graphics routines in a Creative Computing - later I'm sure it showed up in RUN or Transactor for the VIC/64.
It was cool for maybe a couple hours... along with thoughts of what games could I use it with (that's how we developed game ideas old-school style, starting with cool little snippets like this.)
"Enjoy what you're doing! If it becomes drudgery, you're doing it wrong!" - Jim Butterfield
Watching the video it occurs to me that the interesting part is that if you randomly print out slashes or backslashes endlessly, you create an endless "maze". It works particularly well on the c64 because the printable graphics set includes a slash and backslash that have no spacing around the character. But you can do the same thing in a terminal like this:
perl -e 'while (1) { print rand() > .5 ? "/" : "\\" }';
Although depending on your font it won't look as compelling as the c64 version.
when there's a perl module for that:
http://search.cpan.org/~jgamble/Games-Maze-1.08/lib/Games/Maze.pm
"The problem with socialism is eventually you run out of other people's money" - Thatcher.
From page 4 of the book:
In short, this is not a programming book, but it appears to be a book of cultural anthropology about programming. Or perhaps a meditation which starts with one simple starting point and branching out in many different directions. Criticizing the program "10 PRINT" as trivial rather misses the point, I should think.
as the Goto 10 is a loop statement w/o end.
Mod me up/Mod me down: I wont frown as I've no crown
At least it would make a nice geeky retro screensaver.
Slashdot don't hurt me
Slashdot don't hurt me
no more.
I guess you've never looked at the Linux source code. There certainly are a (very) few gotos, but it is certainly not "filled" with them. They are very rare indeed.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
I think the slashdot editor read a little bit too much into this quote "It uses a GOTO instead of a more elegant loop." This doesn't mean it has no loop as stated here on slashdot.
This article is the least interesting thing in a long time. Sure it's sorta cool that one line makes a cool looking screen on your commodore, but to extrapolate the grand claims that the article and the book make is nuts!
I KUT J00 M4NG!!!
10 PRINT CHR$ (47+45*INT(RND (1)+0.5));: GOTO 10 : REM USES ASCII
You get a free book.
It certainly has the intricate path part down, but most people would take issue with a "maze" that lacks a beginning, end, or any guarantee that you can get from point A to B even if you consider obvious closed loops out of bounds.
--- Most topics have many sides worth arguing, allow me to take one opposite you.
strings /dev/urandom|tr -dc '/\'
God, root, what is difference ?
It's not quite as impressive in ASCII (or Bash):
#!/bin/bash
char[0]='/'
char[1]='\'
while :
do
echo -n ${char[$(($RANDOM % 2))]}
done
I tried to include the output here, but Slashdot told me to "Please use fewer 'junk' characters"
loop{print(rand(2)==0?'/':'\\')}
The G
Wow. Who would have known that the code for Diablo is so simple.
Look closely, there are NO deadends.. Not a maze. Just pretty.
And since when's an infinite loop not a loop?
No.
OK, well this is C64-specific because it relies on C64's PETSCII table.
http://www.c64-wiki.com/index.php/PETSCII
\ is at 109, / is at 110.
According to the wiki, "Codes 192-223 as codes 96-127" so the program could've used 109.5 instead of 205.5.
CHR$ 205 prints \
CHR$ 206 prints /
RND(1) returns [0 to 1), so adding the value to 205.5 and truncating the float either makes 205 or 206.
PRINT with ; does not move to next print zone
: separates statements
GOTO 10 loops
This type of thing has a pretty honourable history. Back in the day, there was actually a (small?) subculture of enthusiasts who experimented with one-line or two-line basic programs (I'm sure this was the case with other platforms/languages as well). Similar to the whole demogroup scene I guess - a way of experimenting and showing off. Each line number of a basic program was limited to I think 256 characters. It could have as many statements (separated by colons) as desired. Some folks would go so far as to 'poke' machine code instructions and then jmp/execute that machine code, but I think that was frowned upon a bit as that seemed a bit like cheating... :) There were contests and so on, and popular magazines like 'Nibble' would regularly publish these mini-programs which thousands of us would type into our computers. In doing so many of us became fascinated by what was possible, even if it promoted a rather unhealthy obfuscated code style...
Naturally today with almost unlimited computing resources available to every programmer, this isn't amazing at all. But back then, this sort of thing _was_ pretty amazing - even if this isn't a particularly shining example of it. Some folks were able to generate real, playable games, or amazing visual animation effects in less than 500 bytes of source. It makes me want to drag out the old Apple II emulator and play around! Man, I wish I hadn't sold that old doorstop apple II... :)
Don't judge me based on my high slashdot user id!
Can it work out the difference between a verb and an adjective?
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
http://www.monkey.org/~timothy/
Obviously the timothy /. admin account has been compromised by a spammer.
How many geeks does it take to screw in a lightbulb? Hundreds. Geeks don't screw in lightbulbs, they debate the nature of the bulb until somebody else comes along and shines some light on the subject.
to let such garbage through on slashdot
int main() { l0: printf("%c", (rand()&1)?'/':'\\'); goto l0; }
In perl, it's still a one-liner.
while (1) { print substr('/\\',int(.5+rand(1)),1); }
REM This isn't a one-liner, but nothing in such a powerful BASIC syntax is. REM SCREEN 1 REM Un-REM the next line to add color, though it isn't as good as the C64 REM COLOR 9, 1 CLS 10 PRINT CHR$(47 + INT(RND * 2) * 45); : GOTO 10
10 PRINT CHR$(INT(.5+RND(1))*45+47);:GOTO 10
main() {1;}
I wrote this in 1985 on an Amstrad CPC. I then added a few extra lines to allow a single pixel to navigate the entire maze using INKEY$ and GET. Great game. Next, do "Hunt the Wumpus" in one line.
int main(){for(;;)putchar("\\/"[rand()%2]);}
The book is worth reading, it retells many things from the beginning of personal computing, exploring subjects along the way. the 10 PRINT one-liner is the motivation but not the topic.
Cheers.
Many of the great programmers of my generation started out this way. It had occurred to a few rare teachers in public school systems in the late 70s to start teaching computer programming, and the tools available to them were things like S-100 CP/M machines, acoustic couplers to downtown PDP-11s, Apple IIs, TRS-80s, and Commodore 64s. BASIC in school was ubiquitous and worked fine for teaching the core concepts of how to design algorithms and data structures. Students who really lit up on this would tend to delve into assembly language as they sought to understand the machines, and many of them would turn into great programmers.
That seems to have largely been lost. Many schools shifted to classes called simply "computers", where the focus shifted to teaching students how to use word processors and spreadsheets instead of how to create them. Typing was made a prerequisite. Today, I regularly encounter programmers 20 and 30 years younger then I who believe that programming mainly consists of bolting components together with as little original algorithm and database design as possible. I believe that this is because the school system curriculums have declined, and that as a result, much of the industry largely consists of hundreds of permutations, all basically the same shallow stuff, that are used to build web sites and applications that run on web sites and bolt them to databases. IIS and Apache on NT or Linux, CGIs written in any of a hundred languages, some interpreted, some not; it's essentially a homogenized slurry, and not much of it is particularly interesting or impressive. A return to a time where most programmers had the ability to consider whether it's better to write a optimized database access method to some custom files or use a canned database rather than simply choosing between several database packages would be a good thing.
Recursion, ya jabroni's.
Back in the 80's I remember finding (via the nascent web) a postscript code snippet that would draw a legal maze. The code drew vertical or horizontal lines one box-size long, and had a rule or two that made sure enough edges were NOT drawn that a path existed from start to end.
If anyone has that lying around, I wouldn't mind seeing it again.
https://app.box.com/WitthoftResume Code: https://github.com/cellocgw
strings /dev/urandom | tr -dc '/.'
Have gnu, will travel.
If you need help with the code, here's a simple explanation:
The RND(1) function will return a floating point value between 0 and 1 (technically, this is 0 to 0.999... but let's just call it 0 to 1). So the part of the code that says 205.5 + RND(1) simply returns a value somewhere between 205.5 and 206.5. Assuming the RND(1) function is a good random number generator, that means half of the numbers will be between 205.5 and 205.9999..., and half will be between 206.0 and 206.5.
The CHR$() function pulls a single character from the Commodore 64's PETSCII table. The address is always an integeter, so if you ask for CHR$(205.999), that's the same as CHR$(205). Similarly, asking for CHR$(206.5) is the same as CHR$(206).
In the PETSCII table, character 205 is a single backslash, and character 206 is a single forward slash. So what the code is doing is very simple: it simply prints either a forward slash or a backslash, and keeps doing it because it loops back to itself.
This same code won't work on Linux or Windows/DOS because in the ASCII table, the forward slash is 057, and the backslash is 134. For ASCII systems, you'd need to (basically) flip a coin and print "\" if heads, and "/" if tails.
And that's all it does. There's no magic. No guarantee it is even a solvable maze. It just looks pretty.
-jh
So it prints an endless set of 'i', with either a circumflex or an "umlaut"?
Sorry, 10 STUFF : GOTO 10 is the use of a loop.
What would be the expected path length in such thing?
AccountKiller
It seems as if every single user on Slashdot felt they had to chime in to alert the world that 10 GOTO 10 is in fact a loop, as if everybody else hadn't already made that point.
Something simple enough for my typical crap-tastic non-programmer level of skill. Definitely not the best, but something. I'm sure somebody could make a one-line version for greasemonkey or whatever. Uses two nested loops, but they seem necessary to keep things reasonable.
function makeCrappyMaze() {
document.write ("<br/>");
charArray = new Array();
charArray = ["\u2500","\u2502","\u250C","\u2510","\u2514","\u2518","\u251C","\u2524","\u252C","\u2534","\u253C"]
for (i=1; i<40; i++) {
for (j=1; j<60; j++) {
randNum = parseInt(Math.random() * charArray.length);
document.write (charArray[randNum]);
}
document.write ("<br/>");
}
}
It could probably be more compact without arrays, but I find the unicode escapes seem to work more consistently than ASCII codes with String.fromCharCode() for the extended set. (Depending on font, I'd get gibberish instead of desired box drawing characters.)
Some combination of random bits is a BMP of you and hitler spooning.
Here's a mishmash of idioms
(dotimes (height 40) (terpri) (loop :for width :from 0 :to 20 :do (format t "~A" (aref #(#\\ #\/) (random 2)))))
Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
on my Commodore 64, made mazes for the school newspaper.
Since there were multiple paths through, I had to find one myself first and add an arrow to tell people where to start.
http://mathworld.wolfram.com/TruchetTiling.html
Enjoyable music made with very short programs.
http://www.youtube.com/watch?v=qlrs2Vorw2Y
http://www.youtube.com/watch?v=tCRPUv8V22o
?php l10: echo chr(47+rand(0,1)*45); goto l10;
10PR.CHR$(6+RND(0));:G.10
which, when entered and then LISTed back out, becomes:
PRINT CHR$(6+RND(0));:GOTO 10
You might also want to POKE 82,0:POKE 712,148 to use the whole screen and make the border colour match the background.
Atari BASIC rounds to the nearest whole number rather than just dropping the fraction; hence the use of "6" instead of "6.5".
(it's actually theï Atari OS doing the rounding, not the BASIC lang. cart. itself)
Daniel Klugh
One lesson my Time Series Analysis professor taught us in college was "If you stare at the numbers long enough you'll see all sorts of patterns in it!", pretty much regardless of whether they're there or not.
This "maze" looks to me a lot like there's more structure than you'd get from a good i.i.d. random number stream. Is it just the mind finding patterns when they're not there, or are there patterns because the BASIC RNG isn't very good and is splattering artifacts all over the output? Most of the BASIC systems I've seen didn't begin to approach cryptographic quality, and were typically simple linear congruential multipliers.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Okay, so where can I download the BASIC code? :-)
Table-ized A.I.
The colon (:) indicates a delimiter of a line, or statement. Thus this example is really two lines.
Similarly, it is possible to write an entire program in BASIC on a "single" line. Which would be nearly impossible to read but it will work.
It wouldn't be a classic loop if you replaced the Goto with Run. It would produce a looping effect by chaining new program starts.
If the code in this article is 'an intricate maze without the use of a loop' than this is a C64 physics engine and also deserves a book:
10 POKE 53281,1: PRINT""
20 POKE 53280,7: POKE 53281,6
30 X = 1 : Y = 1
40 DX = 1 : DY = 1
50 POKE 1024 + X + 40 * Y, 81
60 FOR T = 1 TO 10 : NEXT
70 POKE 1024 + X + 40 * Y, 32
80 X = X + DX
90 IF X = 39 THEN DX = -DX
100 Y = Y + DY
110 IF Y = 24 THEN DY = -DY
120 GOTO 50
Gee! I wonder whether it can be ported to other inferior languages. We must produce more geniuses. Our civilisation is about to be annihilated!
I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
This should work in most advanced POSIX shells (though /bin/sh won't support $RANDOM if it's dash or some other leaner version)
while :; do [ $((RANDOM%2)) = 0 ] && printf / || printf \\; done
To all those people saying goto is a loop: it's only effectively a loop. Goto itself is not a loop, it's an assembler's jump and can do lots of things that loops cannot (loops and conditionals are implemented as jumps). For example, goto has no sense of nesting (or scope) and can be called in the most unexpected of places. This is why it's present but considered taboo in most languages.
Also note that for maximum effect, you need a fixed-width font whose width equals its height and as much space between lines as is used between consecutive characters.
Of course, if this kind of thing interests you, there's more impressive things you can do for pretty effects in short snippets of code.
Use my userscript to add story images to Slashdot. There's no going back.
I must be getting very old. Back in the 8-bit heyday (1979-1983), Softside Magazine (for TRS-80, Apple ][ and Atari 800 users) used to have 2 submission contests that they ran in almost every issue: One line programs ( "one-liners" I think they called them) and 1K programs (program size without running = 1023 bytes or less).
The TRS-80 was probably the best machine for one-liners as a single line could be 245 or so characters long (the Atari was limited to 120 characters, but you could abbreviate some keywords, I don't recall the Apple ][ Basic line limit).
The one-liner I remember the most was a graphical version of the old "Lunar Lander" game for the TRS-80. Yes, graphical. A loop (X =0 to X= 127) created the lunar landscape, followed by a loop which updated the state machine of your ship (a single "dot" drawn with the SET and RESET commands) that factored in which keys you were holding down (PEEK of the keyboard matrix I think), and tested to see if you hit the ground with your velocity under some threshold. *THAT* single-line effort was certainly more interesting that the one presented here.
..art theory article.
Film at 11.
*sigh*
The no-loop version would be an entire maze printed on a single line ...
Avoid your fears , or wonder at the past
In my eyes, this is way more impressive - the link contains a detailed explanation of how it was achieved.
Tetris in one line of BBC Basic
And here's the final code:
0d=d:IFdVDUd:a=POINT(32*POS,31-VPOS5):RETURNELSEMODE9:GCOL-9:CLG:O
FF:d=9:REPEATVDU30:REPEATGOSUBFALSE:IFPOS=28VDUPOS,15,VPOS,24;11,26:IF0E
LSEIFa=0PRINT:UNTIL0ELSEUNTILVPOS=25:v=ABSRNDMOD7:i=0:VDU4895;3:REPEATm=
9-INKEY6MOD3:FORr=TRUETO1:t=rANDSGNt:IFt=rCOLOURv-15:VDUrEORm:i+=m=7AND9
-6*r:IF0ELSEFORn=0TO11:d=n/3OR2EORd:GOSUBFALSE:IF1(n+i)MOD12AND975AND&
C2590EC/8^vVDU2080*ABSr;:t+=a:IF0ELSENEXT,:VDU20:UNTILt*LOGm:UNTILVPOS=3
int printf(char*,...);int rand(void);int main() { ten: printf("%c", (rand()%2)?47:92); goto ten; }
Fixed that, single line and no unnecessary includes. A C #include just reads the contents of a different file, in this case only the declarations of printf and rand stored in stdio.h are of interest and can be used without the #include.
The article says it doesn't use a loop, but "10 GOTO 10" is an infinite loop.
It doesn't really generate a maze. A true maze has one entrance, many dead ends and one exit or solution. This is just random generated loops that resemble a maze.
The "book" is meaningless drivel written in a style that seems to produce anger in the reader which I believe is the intent.
- A Frog in a pond utters an azure cry. -
There is a metaphysical discussion wrapped in the fact that the title of the book has a syntax error...perhaps I'll write a book.
something for geeks to wear on a t-shirt as the pattern has some geek creds ;)
This sig can be distributed under the LGPL license
7734 PRINT CHR$ (205.5 + RND (1)); : GOTO 7734 Saw a code snippet in a microsoft manual in the mid 80's that used 7734 as the target.
I have been playing around, in an amateurish way, with is for years. The slight difference is that I wanted a maze that was random but consistent. If you return to a location it same as before. All you need to do is to seed the random number generator with the maze coordinate. What I did not expect is how pretty they look. Examples http://www.infinitemaze.com/2.html.
No one argues that "goto" is a looping command; they're arguing that the program contains a loop implemented with a goto.
If we're going to split hairs like that, how about also noting that printf isn't a builtin with the POSIX shell (http://pubs.opengroup.org/onlinepubs/009695399/idx/sbi.html), so that's not truly a shell program. http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html for the full reference.
Should we tell these people about 1KB Roguelikes which implement an entire adventure game in a single line with 1024 characters? Probably not or they'd have an orgasm.
A maze created with this algorithm, false colored:
http://img841.imageshack.us/img841/1472/fooout.png
While there are many very small components, there are also some pretty large ones. I wonder how large they can get on average (so some sort of probability-based proof)?
How is this even published here. It's a big steaming pile of crap. No wonder the types of people you want here have stopped coming. I keep saying that I won't be back but I invariably return. Once this website's articles provoked wonder and awe.
The new right fascists are bilingual. They speak English and Bullshit.
Neither is $RANDOM, as noted above. That was a bash script (also noted above). Printf is a bash builtin.
Why hasn't timothy been fired yet?
Here is a 13 bytes version in 6502 machine code:
7C 00 20 D2 FF A1 85 29 01 E9 92 D0 F5
(Save this as a .prg file and run it in your favourite C64 emulator or on the real thing itself. Please note that the first two bytes are actually required by .prg file format to indicate load address. The actual code is 11 bytes).
For more information:
http://pouet.net/prod.php?which=60810
I am not a programmer. I do understand that goto makes the line repeat, so when I said that it had no loops all I meant was that it didn't use more conventional methods such as do until and for loops. For me this was interesting because it just one line a code and it can do something interesting as in like David Ahl books. As a nonprogrammer (I only tinker in code on occasion) I find little snippets of code that do something interesting, even if its noise or chaos to you, interesting none the less.
For fun I made a JS version. It uses images to draw the maze and similarly doesn't use variables or "a loop"
setInterval(function() { document.write(' 0 ? 'kNsS0' : 'NfWrh') + '.png" />'); } , 10);
if you stick a "javascript:" in front of it, it can be run from the address bar.