One-liner to determine who wins in Rock, Paper, Scissors
Posted
by asmeurer
on Stack Overflow
See other posts from Stack Overflow
or by asmeurer
Published on 2010-05-08T19:53:47Z
Indexed on
2010/05/08
19:58 UTC
Read the original article
Hit count: 321
So I am writing a simple Rock, Paper, Scissors game in C (it's for an assignment by the way, though the main thing is to learn sockets. Also, I suspect it will be due before I get a good answer). I have it setup as Rock=0, Paper=1, and Scissors=2. Is there an easy one-liner to determine who wins? I tried playing around with it on paper, but I couldn't figure out any patterns.
© Stack Overflow or respective owner