AnyNumberPairs
AnyNumberPairs is a sample game, which demonstrates the seating properties
of a game which any even number can play, in partnered pairs.
(The implementation enforces an upper limit, which is eight (four pairs)
for purposes of demonstration. In a real-world
game of this type, it would be perhaps twenty.)
The game can begin whenever there's at least one pair of seats occupied.
Sending sit(self) with no seat ID has a special behavior:
it tries to place you in an empty seat whose partner is occupied.
If there is no such seat, you are placed in the first unoccupied seat.
If no seat is unoccupied, the call fails.
Seat IDs
seatnorth0
seatsouth0
seatnorth1
seatsouth1
seatnorth2
seatsouth2
seatnorth3
seatsouth3
RPCs
game.win()
-- The first client to send this wins the game.
More of my Volity work
Volity home page