PDA

View Full Version : How Does a Single Line of BASIC Make an Intricate Maze? [Slashdot]



DP ServBot
12-01-2012, 02:20 PM
http://feedads.g.doubleclick.net/~at/ubFgAnpuNG6RZW2hE6EWuruZBrQ/0/di (http://feedads.g.doubleclick.net/~at/ubFgAnpuNG6RZW2hE6EWuruZBrQ/0/da)
http://feedads.g.doubleclick.net/~at/ubFgAnpuNG6RZW2hE6EWuruZBrQ/1/di (http://feedads.g.doubleclick.net/~at/ubFgAnpuNG6RZW2hE6EWuruZBrQ/1/da)
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 with out the use of a loop, variables and without very complicate syntax." Now that amazing snippet of code is the basis of a book, and the book is freely downloadable. http://a.fsdn.com/sd/twitter_icon_large.png (http://twitter.com/home?status=How+Does+a+Single+Line+of+BASIC+Make+a n+Intricate+Maze%3F%3A+http%3A%2F%2Fbit.ly%2FSxtNx 6) http://a.fsdn.com/sd/facebook_icon_large.png (http://www.facebook.com/sharer.php?u=http%3A%2F%2Fdevelopers.slashdot.org% 2Fstory%2F12%2F12%2F01%2F1847244%2Fhow-does-a-single-line-of-basic-make-an-intricate-maze%3Futm_source%3Dslashdot%26utm_medium%3Dfacebo ok) http://www.gstatic.com/images/icons/gplus-16.png (http://plus.google.com/share?url=http://developers.slashdot.org/story/12/12/01/1847244/how-does-a-single-line-of-basic-make-an-intricate-maze?utm_source=slashdot&utm_medium=googleplus)

Read more of this story (http://developers.slashdot.org/story/12/12/01/1847244/how-does-a-single-line-of-basic-make-an-intricate-maze?utm_source=rss1.0moreanon&utm_medium=feed) at Slashdot.
http://slashdot.feedsportal.com/c/35028/f/647381/s/262a749d/mf.gif

http://da.feedsportal.com/r/151883065754/u/49/f/647381/c/35028/s/262a749d/a2.img (http://da.feedsportal.com/r/151883065754/u/49/f/647381/c/35028/s/262a749d/a2.htm)http://pi.feedsportal.com/r/151883065754/u/49/f/647381/c/35028/s/262a749d/a2t.imghttp://feeds.feedburner.com/~r/Slashdot/slashdotGames/~4/FMcl5SVFCBk

Niku-Sama
12-04-2012, 05:45 AM
thats a new one on me. i want to try this out but my vic 20 is packed away

jb143
12-04-2012, 11:09 AM
thats a new one on me. i want to try this out but my vic 20 is packed away

It's not so much a maze as randomly printing /'s and \'s.

I recreated it in Excel for fun...
=IF(RAND()>0.5,"/","\")

Here's the output (you'll have to imagine that the ends connect). As you can see, there's no real path, start, end, or even branches. Just something that superficially resembles a maze.


\\/\/////\///\\//\\//\/\/\//\\/\
/\\\\\\\//\//\\///\\//\\\\/\\/\/
/////\\\\\//\///\\\\\\\/\\\//\/\
\\/\\/\\\//\\/\\/\\\////\\\/\///
//////\/////\\//\/\/\\\\\////\//
\/\///\\//\\\///\\/\/\\\///\\/\/
\\\///\\\\\\///\\/\\/\/\\/\/\\/\
/\\////\//\//\\\\/\/\\///\/\\\\\
\////\\\\\/\\//\/\/\\\\\\////\/\
//\////\/\\//\\/\/\/\\\/\/\\//\\
/\\///\/\\/\/\\///\\////\//\\///
//\\\/\/\///\/\/\\///\\/\/\/////
\\/\//\\\\/\//\/\\\\\\/\\//\\//\
////\///\/\\\//\//\\\\//\\\/\//\
\/\/\/\/\\\///////\//\\/\\\\\/\/
/\//\/\\\/\\\\\\\///\//////\\/\\
/\\/\\\\///\//\\\\/\//\/\/\/\\\\
\\///\/\\/\//\/\\///\\////\/\/\/
\\\\\\//\///\////\///\///\/\/\//
\\/\/\\///\//\\\\\/\\//\//\/\\//
/\\\\/\/\/\////\\\/////////\/\\/
//\//\/\\/\\\//\\/\/\/\\///////\