Playing rock paper scissors over online chat.

4.8k Views Asked by At

Is there a way to play rock, paper and scissors fairly over internet chat? By this, I mean that both players cannot play their hands simultaneously, one of them has to go first and the second player should have no way of cheating.

One possibility is to use complexity to buy time. Encrypt messages and send messages before the codes can be reasonably broken. Exchange keys afterwards as described by Asaf below (and what I originally wrote here somewhat messily).

This is pretty inelegant and kind of vague but I am not sure one can do better...

2

There are 2 best solutions below

6
On

Each player encrypts their move, and keys are exchanged only after both moves have been played.

If you set a time window in which the exchange happens, and you use sufficiently secure keys and ciphers this will ensure no cheating was involved.

Another option IA using a trusted third party to hold the moves. Why should you trust them is a whole other thing, though.

7
On

This assumes that the players have to play within, say, a second of each other.

Generate a list of the numbers $1-999$. $333$ of them are randomly chosen to represent rock, $333$ represent paper, and $333$ represent scissors. You'll end up with lists like:

  • Rock: $697,442,21,31,\dots$
  • Paper: $69,889,614,924\dots$
  • Scissors: $855,523,877,644,\dots$

Each player simply chooses a random number from among the desired list and sends that. Since the players must play within a second of each other, there's no way the second player can look up what the first player's number represents before playing.