Back to front pageView on Hacker News (opens in a new tab)Ask HN: What is the most beautiful piece of code you've ever read?476 pointsby seisvelas (on Hacker News)7 years agoPreferably an elegant snippet rather than an entire (well engineered) codebase.Comments (380) 116 threadsShow all commentsShowing thread 56 of 116tcgv7 years ago#One of the first recursive algorithms I learned was the solver for the Tower of Hanoi problem. I was stunned about its simplicity, solving a problem most people couldn't with just a few lines of code:- https://en.wikipedia.org/wiki/Tower_of_Hanoi#Recursive_solut...
Ask HN: What is the most beautiful piece of code you've ever read?476 pointsby seisvelas (on Hacker News)7 years ago
tcgv7 years ago#One of the first recursive algorithms I learned was the solver for the Tower of Hanoi problem. I was stunned about its simplicity, solving a problem most people couldn't with just a few lines of code:- https://en.wikipedia.org/wiki/Tower_of_Hanoi#Recursive_solut...
Comments (380) 116 threads
Show all comments
Showing thread 56 of 116
- https://en.wikipedia.org/wiki/Tower_of_Hanoi#Recursive_solut...