Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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: