Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
candu
on Oct 29, 2019
|
parent
|
context
|
favorite
| on:
Ask HN: What is the most beautiful piece of code y...
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
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: