How Does a Single Line of BASIC Make an Intricate Maze? 438
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.
Without the use of a loop!? (Score:5, Insightful)
What is
10 something: GOTO 10
if not an (endless) loop?
Re:Without the use of a loop!? (Score:5, Informative)
That's exactly what I thought... Maybe JameskPratt isn't a very good programmer.
Re: Without the use of a loop!? (Score:4, Funny)
Pratt by name . . .
Re:Without the use of a loop!? (Score:5, Funny)
Maybe he's trolling to see who will admit that they know BASIC.
Re: (Score:3)
What programmer doesn't know/can't figure out rudimentary BASIC?
Re:Without the use of a loop!? (Score:5, Interesting)
Indeed, it isn't exactly rocket science -- zillions of kids under 10 picked up the basics of BASIC from type-in programs in kids books and magazines back in the 80's.
What bugs me most is that instead of doing the obvious (making a binary tree maze) it's some weird artifact of how the / and \ combine on-screen that makes something that vaguely resembles a maze -- full of loops (no big deal) large winding sections without any junctions (bad), and isolations (terrible!).
Just for fun:
IBM PC users! You can modify the C64 program in the summary to both run on your micro and produce a binary tree maze with this simple change: PRINT CHR$(220 + INT(RND(1)*2) );
You won't be able to get the same effect with alternating forward- and back-slashes with something like PRINT CHR$(47 + INT(RND(1)*2)*45); as they don't connect at all -- neither on the same line nor between lines.
Re:Without the use of a loop!? (Score:5, Interesting)
A binary tree maze algorithm will generate a "perfect maze" (no loops, isolations, and only a single path between any two cells), though you need a long hallway along two sides (depending on which edges you use for walls).
Mazes with square cells share edges, so by assuming some rules about the outside walls of a maze, you can represent each cell in a maze with only two bits. You need only store, for example, just the south and west walls of each cell.
To make a binary tree maze, first assume an outer wall and a long hall (no south walls) in the first column, and along the bottom row (no west walls). For all remaining cells, randomly add a west or south wall. You don't need any information about adjacent cells -- just flip a coin and draw a wall for each remaining cell. This will produce a "perfect maze". It's pretty cool.
The code I posed will generate a binary tree maze, though it won't show the two long halls. (In this case, the program uses west and south walls, so the halls will be the in the first column and the along the bottom row.)
The lameness filter doesn't want me to show you an example. Still, it's pretty easy to make a nice binary tree maze generator yourself. Give it a try and you'll see how it works.
For fun, you can make four binary tree mazes and arrange them so that you have two long halls (one East to West, the other North to South) intersecting at the center of the maze, just by choosing which pair of walls to randomly generate in each quadrant. It makes a much more interesting looking maze without adding much complexity (just figure out which quadrant the current cell is in) and retaining all of the properties of a perfect maze.
I hope that helps.
Re:Without the use of a loop!? (Score:5, Interesting)
Try something like this. (Keeping with the BASIC theme)
10 CLS
20 W = 10
30 H = 10
40 RANDOMIZE TIMER
50 FOR I = 1 TO W: PRINT " __"; : NEXT I
60 PRINT ""
70 FOR I = 1 TO H
80 PRINT "| ";
90 FOR J = 1 TO W - 1
100 IF INT(RND(1) * 2) = 0 THEN PRINT " __"; ELSE PRINT "| ";
110 NEXT J
120 PRINT "|"
130 NEXT I
140 PRINT "|";
150 FOR I = 1 TO W - 1: PRINT "__ "; : NEXT I
160 PRINT "__|"
Lines 20 and 30 specify the width and height of the maze
Lines 50 and 60 draw the north outer wall of the maze
Lines 70 - 130 draw the maze by randomly drawing either a west or south wall.
Line 80 draws the first cell in a row, which won't have a south wall, to make a long empty hall
Line 120 draws the east-most outer wall at the end of each row
Lines 140 - 160 draw the last row, just a long empty hall.
You'll see that the maze has no loops or isolations. Every cell is reachable from every other cell by a single path.
Hope that helps. Happy maze making!
Re: (Score:3)
I can't think of any processors that don't have a JUMP or equivalent. So, assembly/machine code.
Intercal has COME FROM, which is basically the same thing.
Re: (Score:2)
[slick salesman voice] This is not your grandchild's looping mechanism! [/slick salesman voice]
Re: (Score:3)
Re:Without the use of a loop!? (Score:5, Informative)
No shit, and it is not a labyrinth either. It is just randomly printing forward slashes and backlashes.
Re:Without the use of a loop!? (Score:5, Insightful)
No shit, and it is not a labyrinth either. It is just randomly printing forward slashes and backlashes.
"an intricate combination of paths or passages in which it is difficult to find one's way or to reach the exit."
it is that. it's just not very amazing at all if you describe it as printing \ and / randomly.
Re: (Score:2)
it's just not very amazing at all if you describe it as printing \ and / randomly.
You are really going to break the author's heart if you keep that up.
It's hard to look at this story and not feel that it's a base case in an inductive proof that refutes the existence of art.
Re:Without the use of a loop!? (Score:5, Interesting)
I think there is a bit of a story in the fact that while in function, it is extremely simple though in result/appearance it creates what most perceive to be a complex maze of passages. The code puts out random positive space objects while the mind sees a single, complex negative space.
It sort of reminds me of similar little tricks used to generate landscapes and other such things... mandelbrot comes to mind.
Re:Without the use of a loop!? (Score:5, Funny)
The code puts out random positive space objects while the mind sees a single, complex negative space.
Sadly, that's the way I'm seeing slashdot these days...
Re:Without the use of a loop!? (Score:5, Insightful)
It sort of reminds me of similar little tricks used to generate landscapes and other such things... mandelbrot comes to mind.
Except that the Mandelbrot set, for example, really is much, much more interesting. It actually has a great deal of sophisticated structure, that's highly chaotic (in both typical and mathematical senses of the word) but not random at all. Not at all comparable to this example, whose output has no real structure at all, but just exploits the tendency of the human brain to find patterns whether or not they exist.
Re:Without the use of a loop!? (Score:5, Funny)
Much like a televangelist or politician then.
Re: (Score:3)
Firstly, the actual maze produced isn't random but is a visualisation of the pseudo-random algorithm used in C64 basic. Who's to say that this doesn't contain structure just as complex as that of the mandelbrot set?
Doesn't matter. Try it with a different PRNG, or a TRNG, and you'll get the same maze-like effect, because the effect comes from the pattern-matching ability of the human mind, not from any real patterns in the slashes.
Secondly, the mandelbrot set may not really contain the structures that we see at all. All those lovely spirals and so-on might just be floating-point artifacts. No-one knows for sure.
Not true. The colors are representations of how many iterations it takes for the point to escape the unit circle (which shows that its absolute value will increase without bound). In portions of the edges of the set (the set itself is the points which remain bounded -- those are indeed har
Re:Without the use of a loop!? (Score:5, Insightful)
It's called a display hack [wikipedia.org]. They're at least as old as the oscilloscope, and have always been a mainstay of the demoscene. The book provides little actual relevant history about the context of this snippet in that regard, only noting that the snippet itself derives from the C64 User's Manual.
Somewhat dismayingly, the bulk of the text ponders on criticism that presumes an intentional, carefully-planned artist:
10 PRINT picks up on aspects of "Mouse in the Maze." Its output is a regular arrangement of "walls" in a grid—akin to the display of that earlier program and similar to the arrangement of the stereotypical laboratory maze. "Mouse in the Maze" does not present the compelling creation of an inspired Daedalus, but a behaviorist experiment. This maze is a challenge to intelligence—not, however, a romantic, riddling intelligence, but a classically conditioned, animal kind. It also brings in the idea of the scientist, who may be indifferent to the struggles of the creatures lost in the maze.
This manner of thinking, now put on display nakedly in the context of something completely mathematical and involving no relevant human imagination, can plainly be seen to be philosophically inconsistent. The author has said that a very simple natural phenomenon is influenced by a complex work of art (specifically a TX-0 game from twenty or so years earlier), which indicates a profound metaphysical error.
Certainly it is worthwhile to talk about chaotic functions (like the R pentamino in Conway's Game of Life, in addition to the display hacks already mentioned) but attempting to critique them as if they were part of the artistic canon is intellectually dishonest.
Re:Without the use of a loop!? (Score:5, Funny)
The code puts out random positive space objects while the mind sees a single, complex negative space.
I don't even see the random positive space objects anymore. I just see blonde, brunette, redhead...
Not even that (Score:5, Insightful)
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.
Re: (Score:3)
Re: (Score:3, Informative)
The difference between a maze and a labyrinth is that the goal of a maze is to get from the entrance to the exit. The goal of a labyrinth on the other hand is to get to the center. If there is no entrance and there is no exit, it isn't a maze by strict definition, but a set of paths.
Re:Without the use of a loop!? (Score:4, Informative)
No shit, and it is not a labyrinth either. It is just randomly printing forward slashes and backlashes.
I disagree, I think this finally proves the existence of god. ;)
Re: (Score:2)
What is 10 something: GOTO 10 if not an (endless) loop?
Well, in certain dialects of Forth, you'd probably be able to write it using tail recursion. And it would be probably slightly shorter. :-)
Re:Without the use of a loop!? (Score:4, Insightful)
Re:Without the use of a loop!? (Score:5, Insightful)
And most importantly - its not a particularly amazing piece of code. I am not a programmer, but know how to write basic stuff in a few languages - and i do not find a TWO LINE LOOP that fills the screen with a choice between two characters that make up something that LOOKS LIKE A MAZE, but is not necessarily navigable not a least bit amazing.
Re:Without the use of a loop!? (Score:4, Informative)
That's be cause you don't appreciate the context in which this code came to exist. Back in the early eighties, to be able to generate such visually impressive and complex looking imagery with so little code, was quite an amazing thing. I, for one, wish I would have known that bit of code back then as a ten year old. It certainly would have beaten my usual "10 PRINT "DAN WAS HERE!!! "; 20 GOTO 10" that I would type into the C64s, TI-99/4As, Atari 800s, and other computers on display at K-Mart and Sears.
For the sake of completeness, here is a version that works with the syntax (and character set) of another home computer of the era, the TI-99/4A
10 PRINT CHR$(INT(RND+.5)*45+47);
20 GOTO 10
The code is a little more complex because the forward and backward slash characters are not contiguous in the TI's character set (47 and 92). The result visually isn't as good because the TI's character glyphs are more spaced out than the C64's. However it does work - I tested it in the emulator (with standard TI BASIC, doesn't required Extended BASIC).
Re:Without the use of a loop!? (Score:5, Interesting)
A simple addition makes the TI-99/4A version look visually just like the C64's. That is to simply define the forward and backward slash characters to look more the C64's and span the whole area of the character's bitmap.
10 CALL CHAR(47, "C0E070381C0E0703")
20 CALL CHAR(92, "03070E1C3870E0C0")
30 PRINT CHR$(INT(RND+.5)*45+47);
40 GOTO 30
Finally, if we're going to go to the trouble of defining character images, then we might as well use contiguous character codes so we don't need the extra math. We could use the C64's exact values, however the TI's character set only has 128 characters. So we'll use values 100 less than the C64 version. Also, the TI rounds floating values to integers, whereas the C64 simply truncates them. So we don't need to add .5 to the random value.
10 CALL CHAR(105, "C0E070381C0E0703")
20 CALL CHAR(106, "03070E1C3870E0C0")
30 PRINT CHR$(105+RND);
40 GOTO 30
Re:Without the use of a loop!? (Score:5, Informative)
And finally, here's a screenshot in case anyone actually cares what the TI version looks like.
http://dexsoft.com/slashdot/ti_screenshot.png [dexsoft.com]
Re:Without the use of a loop!? (Score:4, Informative)
Actualy, it absolutely is just one line of code. You are confusing the number of statements with the number of lines. In BASIC, as in many languages, you can have multiple statements and operation in a single line of code. Those statements do indeed however constitute an infinite loop, however.
Re:Without the use of a loop!? (Score:5, Insightful)
Re: (Score:3)
This would be true if it were not for the pre-processor. You cannot, for example #include multiple external files on the same line or have multiple #defines on the same line. As far as "going that route" goes, the only route I took was making factually correct statements to correct the factually erroneous ones repeated far too many times on this subject. This isn't open to interpretation, unless you happen to be a C interpreter* that is ;-)
* B
Re:Without the use of a loop!? (Score:5, Informative)
main() { ten: printf("%c", (rand()%2)?47:92); goto ten; }
The preprocessor include directive is on a separate line, but that's really not part of the program.
Re: (Score:3)
It might generate a warning on some compilers, but it's a perfectly valid C program. In fact, since this program uses rand without declaration, it might as well use printf.
Nothing prevents one from doing this, though:
int rand(void); int printf(const char * restrict f, ...); main() { ten: printf("%c", (rand()%2)?47:92); goto ten; }
(Remove the "restrict" before "f" for C89)
In general, though, ISO C doesn't require translators (the technical name the ISO uses for C compilers/interpreters) to accept lines gre
Re: (Score:3)
OK, now it's clear that you have absolutely no idea what you're talking about -- you might want to read the C standard, or at least test it on a compiler.
If you're interested to learn, here's a general explanation:
The function declarations usually present in header files just tell the compiler what are the parameters accepted by the function, and what is the function return value. In C (not C++), these declarations are not required. If a function with no declaration is called, the compiler/interpreter/whate
Re: (Score:3)
I was thinking of posting something like the GP's post but after reading yours, I went to check and you're right. Spectrum Basic had multi-statement lines. ZX81 basic didn't though so there may be some validity though it can rightfully be regarded as very far from a standard basic with many missing features.
Re: (Score:3)
I accept your apology.
Re: (Score:3)
Note the second paragraph of that page, where it mentions that the version of Sinclair BASIC used on the Spectrum was an *update* of what was used in the ZX80 / ZX81 (which was also called Sinclair BASIC funnily enough). Also note that I mentioned *1981* and that the Spectrum 16K came out in *1982* . Get it now?
Re:Without the use of a loop!? (Score:4, Informative)
Re: (Score:2)
Sad day for slashdot... (Score:5, Insightful)
...when the summary does not know what a loop is.
Re:Sad day for slashdot... (Score:5, Funny)
Re:Sad day for slashdot... (Score:5, Interesting)
Also, it can't string together a single grammatically correct sentence. Complete failure on both technical and English levels!
The book is, however, quite interesting (just go straight to the open-access PDF and skip the mediocre Slate article).
No loop? (Score:5, Insightful)
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.
Re: (Score:2)
Just missing BASIC experience...like I had in the 70s.
Re: (Score:2)
and it's not even a single line.
Would it count anyway? Including a library function that implements a PRNG algorithm hardly sounds like "a single line of BASIC"...
(Not criticizing the book, which I've never read -- it may be a great book for all I know.)
Re: (Score:2)
Yes, it would, if only because RND is an official ANSII BASIC statement, not an external library. Common people, all this stuff is pretty basic .... ;-)
Re:No loop? (Score:5, Informative)
Nobody knows that, because it is untrue. The : is a statement separator, not a line seperator. That 10 you see is the line number. Notice that there are no other line numbers. Make an error on either side of the colon and the interpreter will give you the exact same complaint: Syntax error in line 10. You can verify this by looking for the line " In BASIC it's used as a separator between the statements or instructions in a single line." on Wikipedia [wikipedia.org], or use your Google-Fu to verify it thousands of other ways.
Re: (Score:2)
10 INPUT "PLEASE INPUT Y OR N: ", A$
20 IF A$ "Y" AND A$ "N" THEN PRINT "INCORRECT": GOTO 10
The "GOTO 10" will only be executed if the condition is met. This is what early BASIC programmers had instead of if statements that supported blocks.
10 ... : GOTO 10 is a loop (Score:5, Informative)
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”.)
Re: 10 ... : GOTO 10 is a loop (Score:5, Interesting)
it's not a maze, it's a pattern of random forward and backward slashes, "/" and "\". There's no guarantee that a path exists anywhere near the top to anywhere near the bottom. In fact, because it's random, you'd be blocked off at some point.
Re: (Score:2)
Re: (Score:3)
In fact, because it's random, you'd be blocked off at some point.
Nonsense. See: Binary tree mazes.
Also, I recommend that you look at other maze generation algorithms (especially Eller's Algorithm) as you can easily create a random yet solvable maze where there is exactly one path between any two cells -- no loops or isolations. In the case of Eller's Algorithm, you can create a random maze of any length that has this property without keeping the entire maze in memory -- just a single line!
Without the use of a loop? (Score:3, Informative)
That....is.....a loop.......
Yes Captain (Score:2, Funny)
that's what our sensors are picking up.
Some minor deficiencies (Score:5, Insightful)
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
Re: (Score:2, Informative)
Re: (Score:2)
Re: (Score:2)
The Slate article does make clear that this only works on something with the old Commodore 64 character set (PETSCII). And that it is a loop.It's not exactly a great article, but it does get these things right.
it would work on anything with the right type of font. if you want to try it on windows cmdline them from prefs select raster fonts and 8x8 pixel font.
(yeah I tested.. with a javascript script of all things, ugh)
Re: (Score:2)
Goto Makes a Loop (Score:3)
Re: "it manages to create a complicated maze with out the use of a loop"
Enterprise Java Version (Score:5, Funny)
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 );
}
}
Python version (Score:5, Interesting)
Re: (Score:2)
Re: (Score:2)
Come now, that's hardly Enterprise Java without a few JDBC connections. ;)
Re: (Score:3)
Re:Enterprise Java Version (Score:5, Informative)
Plagiarizer. You stole this from reddit -- from the same post linked from Nick Montfort's blog.
Enterprise Java Version:
http://www.reddit.com/r/programming/comments/142jix/10_print_chr_2055_rnd_1_goto_10_how_a_single_line/c79elxn [reddit.com]
You shouldn't take credit for the work of others. That +5 funny is a filthy dirty lie.
Re: (Score:3)
Re:Enterprise Java Version (Score:4, Interesting)
Actually, when the code is idiomatic, it is a reflection on that language/frameworks that go with it. Having spent a bad 5 years in enterprise java trenches I can vouch for the realism of that code. It gave me flashbacks. I'm still fucking shivering.
Re:Enterprise Java Version (Score:4, Funny)
Perl version: Search CPAN, someone's bound to have written a maze module.
Without looping? (Score:2)
How does this not use a loop?
Perl analogue (Score:5, Interesting)
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.
Re: (Score:2)
You beat me to it. Even sweeter.
Really? (Score:5, Insightful)
Frontpage slashdot story with a 10 GOTO 10 and saying it's not a loop?
Dudes, just what the fuck. I ask you that.
Re: (Score:2, Funny)
It's a step up from the plastic on Mars story a few days ago.
Re: (Score:3, Insightful)
What the fuck? I'll tell you what the fuck... Slashdot as it stands today is a sad, pale reflection of the Good Slashdot of Old.
The focus isn't "News for Nerds" anymore, it's "Bash Apple Good... and oh, here's some code too."
A slow day on /. ? (Score:2)
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.
Re: (Score:2)
Is it a maze or does it just look like one?
It is a maze. It doesn't necessarily have exactly one solution (It probably has more than one). It doesn't necessarily have any solutions.
The loop never seems to terminate, so it seems that the maze will keep getting larger until the program is manually aborted
Multi-Fail (Score:4, Interesting)
Re:Multi-Fail (Score:5, Interesting)
The article reads to me like a sophomore-level paper deconstructing some insignificant piece of drivel and claiming great insights into human nature.
"What can this one line -- '10 PRINT,' to use the authors' shorthand -- teach us about software, and culture at large?"
Damn! And that's just the review, I can't even imagine what the actual 294-page book must be like. Next up I expect a 500-page treatise on Vogon poetry.
/., in collaboration with the Erowid Vault (Score:2)
80s Flashback (Score:3)
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.)
Tricks with Slash and Backslash (Score:2)
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
Re:Tricks with Slash and Backslash (Score:4, Funny)
perl -e 'while (1) { print rand() > .5 ? "/" : "\\" }';
Quick, claim it doesn't have a loop and write a book. :)
Bah why write the code... (Score:4, Informative)
when there's a perl module for that:
http://search.cpan.org/~jgamble/Games-Maze-1.08/lib/Games/Maze.pm [cpan.org]
A meditation (Score:4, Informative)
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.
A simple Linux port (Score:3, Insightful)
strings /dev/urandom|tr -dc '/\'
Re:A simple Linux port (Score:5, Insightful)
Sorry, what was I thinking? This is obviously more elegant:
tr -dc '/\' </dev/urandom
Diablo (Score:4, Funny)
Wow. Who would have known that the code for Diablo is so simple.
i prefer c over basic (Score:3, Interesting)
Book not so bad (Score:3)
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.
Reminded me of DataGlyphs (Score:5, Informative)
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 [slashdot.org].
Re:A maze (Score:2)
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?
Re: (Score:2)
this "goto recursion" does not crash, because there is no stack to be able to jump back.
Re: (Score:3)
It eventually fills up the galaxy with ascii chars and the world ends.
No, not Linux too ... (Score:2)
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.
Re: (Score:3)
Here you go:
http://peter.sorotokin.com/maze/Maze.html [sorotokin.com]
It's just below the java applet.
Re:Record breaking (Score:4, Funny)
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.
The thing is, GOTO 10 is a loop. Therefore it's not without a loop. QED.