A single line of Basic sends readers into a labyrinth
1–10 of 91 posts
Re: A single line of Basic sends readers into a labyrinth
#2Highly recommend picking up this book. As a former local colleague of Nick Montfort, I can say it's going to be a great read.
Re: A single line of Basic sends readers into a labyrinth
#3I remember learning this trick, not sure where I learned it from but this particular snippet had a huge impact on me. I spent hours and hours playing with variations on this.
Re: A single line of Basic sends readers into a labyrinth
#4The article seems to be a a lot of hyperbole without much substance.
The code itself is simple. CHR$(205.5 + RND(1)) becomes CHR$(205) or CHR$(206) depending on the random number. 205 generates a \ , and 206 generates a /.
Re: A single line of Basic sends readers into a labyrinth
#5Can this book not be available in digital form? Amazon and MIT Press only list the hardcover edition.
http://mitpress.mit.edu/books/10-print-chr2055rnd1-goto-10-0
Re: A single line of Basic sends readers into a labyrinth
#6Can this book not be available in digital form? Amazon and MIT Press only list the hardcover edition. http://mitpress.mit.edu/books/10-print-chr2055rnd1-goto-10-0
The article links to the book's (free) download page: http://10print.org
Re: A single line of Basic sends readers into a labyrinth
#7I've always had a soft spot for mazes. Seeing how a recursive function could solve a maze was what got me hooked on programmng to begin with. At the time it was mind-blowing. It was the first time that software seemed like magic.
Re: A single line of Basic sends readers into a labyrinth
#8If you were like me back in the 80s on a PET you did that and then moved up to more complex randomness with other graphic symbols like the four corner curves or bends. I think they had that line in one issue of Creative Computing with a bunch of other character graphic effect snippets.
Re: A single line of Basic sends readers into a labyrinth
#9The article seems to be a a lot of hyperbole without much substance. The code itself is simple. CHR$(205.5 + RND(1)) becomes CHR$(205) or CHR$(206) depending on the random number. 205 generates a \ , and 206 generates a /.
10 PRINT MID$("/\",1.5+RND(1),1);:GOTO 10
Run it on another old-school computer, like an Apple II, and you won’t get the same transfixing result, for details that have to do with the Commodore 64’s character set, called PETSCII.Re: A single line of Basic sends readers into a labyrinth
#10A version that works in bash:
yes 'c=(╱ ╲);printf ${c[RANDOM%2]}'|bash
Source and credit: http://stackoverflow.com/a/13612327