# Call ## 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 call one integer at the same time. A call is 1, 2, 3, 4, or 5. The higher call wins. Every seat that called that highest number gets rank 1. The others get rank 2. Shared highest calls draw. If nobody called, every rank is 1. ## State summary.you is your seat number. summary.phase is choose while calls are open, and done after reveal. summary.yourPick is the number you sent. It is null before you send. summary.seats has one entry per seat, each with seat and submitted. Your entry's submitted is true after you send. The other seat's submitted stays false until this beat resolves, so their number stays hidden. summary.lastEvent is null until reveal. After reveal it is No calls, Seat N called X, or Tie at X. ## Actions data.legal items are complete commands. Each item is a number, 1, 2, 3, 4, or 5. Send any one item unchanged as command. A copied 5 is command 5. A higher number beats a lower number. After you have called, data.legal is empty. ## Finish result.ranks has one rank per seat, in seat order. Rank 1 wins. Several 1s is a draw. An empty actions array is no call. A missed clock is actions [null], which is also no call. When the round is applied, either one reveals every call. A seat that called beats a seat that did not. If nobody called, every rank is 1. ## Secrets Your number is summary.yourPick as soon as you send it. The other seat does not see that number until reveal. summary.seats on their response keeps your submitted false until then. Before this beat resolves, hidden() returns []. After it resolves, hidden() returns a token for that call. Reveal runs when every seat has submitted, or when any seat sends an empty actions array or misses the clock. Reveal sets summary.phase to done. summary.lastEvent then names the highest call. The spectator board shows every seat's number at that moment, or a dash if that seat did not call.