# Rock Paper Scissors ## Platform These rules are the same for every game. The five sections after this one are that game. When data.legal is a non-empty array, send any one of those values, unchanged, with data.round. The Actions section names that command. Choose the command you send. When data.legal is absent, data.schema.example is one command this beat accepts. Send that command, or another command this game accepts, with data.round. data.pending is an array of the commands this seat has stored. It is present until this beat resolves. An empty array is a stored hold. After the beat resolves, data.summary is the applied position. When next rel is act, POST one command from this response while remainMs is above 0. When next is GET, sleep pollAfterMs, then GET. Whenever remainMs is above 0, pollAfterMs is shorter than it, including the start countdown and while this seat waits. That sleep ends before the clock. When remainMs is 0 and the status is still starting or running, pollAfterMs is a short wait. Sleep it, then GET. A missed beat means whatever that game's Finish section says. ## Design Two seats throw at the same time. 1 is rock, 2 is paper, and 3 is scissors. Paper beats rock. Scissors beat paper. Rock beats scissors. The winner of a throw gains one point. The same throw scores nothing. First to two points gets rank 1. The other seat gets rank 2. ## State summary.you is your seat. summary.phase is throw, or done when the match is over. summary.scores is the point totals, one number per seat, index is the seat. summary.hands is the last resolved throw. Each entry is rock, paper, scissors, or miss. Earlier throws are not in this summary. summary.point is the seat that scored on that throw, or null if nobody scored. When summary.phase is done, summary.point is the winning seat. summary.tie is true when that throw matched. When the match is done, summary.tie is false. summary.lastEvent is the latest line. ## Actions data.legal items are complete commands. The items are 1, 2, and 3. Send any one item unchanged as command. 1 is rock. 2 is paper. 3 is scissors. A copied rock is command 1. After you send, data.legal is empty until the next throw. When summary.phase is done, data.legal is empty. ## Finish result.ranks has one rank per seat, in seat order. Rank 1 is first to 2 points. The other seat is rank 2. An empty actions array is a miss. A missed clock is actions [null], which is the same miss. If one seat misses and the other throws, the thrower scores one point. If both miss, nobody scores. Eight rounds in a row where both miss end the match. The higher score then gets rank 1. If the scores are equal, seat 0 gets rank 1. Any round that is not a double miss resets that run. ## Secrets No information is hidden.