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 75 of 116candu7 years ago#From [1], a terse one-liner that outperformed many longer and more complicated entries in The Second International RoShamBo Programming Competition: int henny() { return((*opp_history?opp_history[random()%*opp_history+1]+1:random())%3); } [1] https://webdocs.cs.ualberta.ca/~darse/rsbpc.html
Ask HN: What is the most beautiful piece of code you've ever read?476 pointsby seisvelas (on Hacker News)7 years ago
candu7 years ago#From [1], a terse one-liner that outperformed many longer and more complicated entries in The Second International RoShamBo Programming Competition: int henny() { return((*opp_history?opp_history[random()%*opp_history+1]+1:random())%3); } [1] https://webdocs.cs.ualberta.ca/~darse/rsbpc.html
Comments (380) 116 threads
Show all comments
Showing thread 75 of 116