Live data from Hacker News

10 PRINT CHR$(205.5+RND(1)); : GOTO 10 (2012)

10print.org

61–62 of 62 posts

Re: 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 (2012)

#61
post #11

You can recreate the magic in bash: while true; do printf "\u$((2571 + ($RANDOM & 1)))"; done

Fun task: write a program which takes such output, identifies all enclosed cells, and breaks them open, so that the maze is connected: any two points in the maze are connected by at least one path.

Bonus: close loops, so any two places in the maze are connected by a unique path.

As a preprocessing step, reformat the data to 77-column-long lines first, removing any whitespace characters, and discarding the last line if it is shorter than 79 characters, and then close off the exterior with solid zig-zags, like this, which are strictly added to the data (no overwriting):

  ╱╲╱╲╱╲...╱╲╱╲╱╲╱╲
  ╲╱╲╲╲╲...╲╱╱╲╱╲╱╱
  ╱╲╲╲╱╱...╱╲╱╱╲╱╲╲
  ╲╱╲╲╱╲...╲╱╲╲╱╱╲╱
   :              :
   .              .
  ╱╱╲╲╱╲...╱╱╲╱╲╱╲╲
  ╲╲╱╲╲╱...╱╱╱╲╲╱╲╱
  ╱╱╱╲╲╱...╱╱╱╲╱╲╱╲
  ╲╱╲╱╲╱...╲╱╲╱╲╱╲╱

Re: 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 (2012)

#62
post #23
post #11

You can recreate the magic in bash: while true; do printf "\u$((2571 + ($RANDOM & 1)))"; done

Doesn't quite work on my mac :/

The obligatory pure ASCII slash-backslash version:

  while true; do printf $(printf "\\\\u%04x" $((47 + 45 * ($RANDOM % 2)))); done
Post reply on HN