News for hackers. Stuff that matters.
Re:Ask HN: What is the most beautiful piece of code you've e... by henkslaaf on Monday October 28, 2019 @03:48AM (#21375023)
What is a maze? One could argue that if the user perceives a maze, then it produces a maze.
Re:Ask HN: What is the most beautiful piece of code you've e... by tenebrisalietum on Monday October 28, 2019 @06:55AM (#21375827)
> One could argue that if the user perceives a X, then it produces a X.

This can be stretched to turn anything into anything else. For example, why can't this comment be a maze? In that case 10 REM; 20 END is my even shorter, more elegant maze program because I see a maze in it.

Some constraints that are typically implied when people say "computer generated mazes":

- They are solvable (have a start and end)

- OR they loop endlessly with no dead ends.

- Walls and spaces consume 1 element on the grid.

- No space on the grid is surrounded by all 4 NWSE walls.

Re:Ask HN: What is the most beautiful piece of code you've e... by coldtea on Monday October 28, 2019 @11:28AM (#21377802)
>>One could argue that if the user perceives a X, then it produces a X. >This can be stretched to turn anything into anything else. For example, why can't this comment be a maze?

Because unlike the one-liner nobody perceives it as a maze, so the "this can be stretched to turn anything into anything else" argument is tenuous...

Re:Ask HN: What is the most beautiful piece of code you've e... by alanbernstein on Monday October 28, 2019 @07:38AM (#21376012)
I believe your third criterion is actually met by this generator. The grid is just tilted 45 degrees.
Re:Ask HN: What is the most beautiful piece of code you've e... by mygo on Monday October 28, 2019 @12:11PM (#21378232)
> This can be stretched to turn anything into anything else. For example, why can't this comment be a maze?

Name one person who perceives your comment as a maze.

It must be perceived as a maze by people for it to apply.

As it stands, I’m not sure if people perceive your comment as a maze.

Maybe theoretically there’s a nonzero number of people who perceive the comment as a maze. But unless your audience is those few people, there wouldn’t be much utility in it. In the OP’s example this maze perception is not only highly widespread but it’s also leveraged for a particular intended effect.

[dead]
Re:Ask HN: What is the most beautiful piece of code you've e... by maxerickson on Monday October 28, 2019 @10:16AM (#21377193)
The idea that words used in specific contexts can't have clear meanings is the more tedious thing.
Re:Ask HN: What is the most beautiful piece of code you've e... by ljm on Monday October 28, 2019 @04:36AM (#21375209)
Never expected to find myself on the path to enlightenment after reading a line of BASIC.
Re:Ask HN: What is the most beautiful piece of code you've e... by lmilcin on Monday October 28, 2019 @06:48AM (#21375791)
Maze has a starting point and a goal. The goal must be reachable from the start.
Re:Ask HN: What is the most beautiful piece of code you've e... by Intermernet on Monday October 28, 2019 @08:07AM (#21376137)
Only if you want to give the occupant of the maze a chance to escape :-)
Re:Ask HN: What is the most beautiful piece of code you've e... by wincy on Monday October 28, 2019 @09:26AM (#21376739)
So this would be more of a labyrinth than a maze?
Re:Ask HN: What is the most beautiful piece of code you've e... by cyphar on Monday October 28, 2019 @10:01AM (#21377056)
No, a labarynth is a single twisting route without branches. A maze has branches and thus can have dead-ends. Both must have an entry and exit point (technically mazes may have more than one exit and entry, but most don't).
Re:Ask HN: What is the most beautiful piece of code you've e... by Someone on Monday October 28, 2019 @01:31PM (#21379287)
That’s open for debate. https://en.wikipedia.org/wiki/Labyrinth:

”Although early Cretan coins occasionally exhibit branching (multicursal) patterns

[…]

both logic and literary descriptions make it clear that the Minotaur was trapped in a complex branching maze

[…]

In English, the term labyrinth is generally synonymous with maze. As a result of the long history of unicursal representation of the mythological Labyrinth, however, many contemporary scholars and enthusiasts observe a distinction between the two.”

Re:Ask HN: What is the most beautiful piece of code you've e... by jedberg on Monday October 28, 2019 @10:42AM (#21377418)
> a labarynth is a single twisting route without branches. A maze has branches and thus can have dead-ends.

I was today years old when I learned this.

Re:Ask HN: What is the most beautiful piece of code you've e... by tromp on Monday October 28, 2019 @09:39AM (#21376858)
Re:Ask HN: What is the most beautiful piece of code you've e... by misterman0 on Monday October 28, 2019 @06:58AM (#21375842)
Jeopardy this: Only then can you realize, there is no maze.