When NullRule is modified, a copy of the original NullRule remains in effect. All rules other than NullRule stay in effect until they are modified, and then go out of effect. Other rules can be modified into NullRule, provided that NullRule does not change. Rules cannot be modified into existing rules other than NullRule. At no time may rules be self-contradictory.
Rule 1. GameSetup
All rules are initially owned by the person with the lowest ID. Before the game begins, the only allowable commands are CreateGame, BeginGame, ModifyGame, EndGame, Join, ModifyPlayer, Shuffle, Unlock, Draw, Put, CommandSet, Retry, AddCards, and RemoveCards. In the game there are initially no cards, no properties, and no rules other than the sixteen listed here.
Rule 2. BeforeBeginGame
Before the game can begin, each person in the game must have either zero or eight cards in his/her "hand". People with eight cards are called "players", and others are called "bystanders". No person can have cards in any other hands. All the remaining cards must be in the "deck".
The only cards in the game must be d "decks of cards", where p/6+1 < d < p/3+2 and p is the number of "players". A "deck of cards" consists of 52 cards labelled with the elements of the Cartesian product of the set of ranks {Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King} and the set of suits {Clubs, Diamonds, Hearts, Spades}.
The game must also have a property named "Turn Cycle" which contains a list of the "players" in which each "player" appears exactly once. Each "player" must have a property named "Pending Rules" which contains the value 0.
The game can begin only immediately after a shuffle involving all of the "players" and all of the cards.
The game may begin at a certain time if and only if all of these conditions are met at that time.
Rule 3. GameDefault
Between the beginning and the end of the game, we say that it is "during" the game. No commands may occur "during" the game except when allowed by other rules. All announcements and private messages are allowed at any time "during" the game, but are not necessarily without consequence.
Rule 4. TurnDefinition
At all times "during" the game, one of the "players" has the "turn". This "player" is the first "player" in the game's "Turn Cycle" property. A "player"'s "turn" ends when his/her name is removed from the beginning of the "Turn Cycle" property.
Or should I say, "a 'player''s when the 'Turn Cycle' property is modified".
Rule 5. DrawDefinition
A "player" "draws" n cards by moving n cards from the "deck" to his/her hand, and unlocking the cards to himself/herself.
Rule 6. Penalty
A rule may assign a series of commands called a "penalty" to a "player". At any time a "player" may announce "Improper," and make another "player" perform a series of commands. If these commands correspond exactly to one of the second "player"'s "penalties," then the second "player" must perform the commands and the penalty is removed; otherwise, the first "player" receives a "standard penalty" of 1.
Rule 7. StandardPenalty
If a "player" receives a "standard penalty" of n, then he/she is assigned the "penalty" "Draw n cards. Reverse the actions which caused the acquisition of the penalty if and only if they are completely reversible and did not involve cards being revealed to you." This "penalty" is revoked at the end of the current turn.
Rule 8. ReservedWords
If a rule makes reference to a "player"'s ability to announce a certain phrase P, then the phrase is called a "reserved word". If a "player" announces a phrase which is equivalent to a string containing P when it would have no effect on the game except from this rule, then he/she receives a "standard penalty" of 1.
Rule 9. PlayDefinition
A "player" "plays" a card by moving a card from his/her hand to the top of the "card pile", and revealing it to all "players". If the card "played" is of a different suit and a different rank than the card previously on the top of the "Card Pile", then he/she receives a "standard penalty" of 1.
Rule 10. Turns
During a "player"'s "turn", he/she must either "play" a card or "draw" one, or both. He/she may not "play" or "draw" more than one card unless another rule states that he/she can.
Rule 11. TurnCycle
When a "player"'s "turn" ends, his/her name is moved from the beginning to the end of the game's "Turn Cycle" property.
Rule 12. EmptyDeck
When the "deck" does not contain any cards, a "player" may move all of the cards in the "card pile" except the top card into the "deck", and shuffle all of these cards, provided that these commands occur simultaneously. This is called a "deck shuffle".
Rule 13. EmptyHand
At any time when a "player" does not have any cards in his/her "hand", then he/she may simultaneously move five cards from the "deck" to his/her "hand", and increment the value of his/her "Pending Rules" property by 1 if it is an integer. If the player has a penalty at the time, then he/she is also assigned the penalty "Decrease the value of your 'Pending Rules' property by 1". This penalty is withdrawn at the end of the current turn.
Rule 14. PendingRules
At any time, a player whose "Pending Rules" property contains a positive integer may simultaneously decrease the value of his/her "Pending Rules" property, and modify a rule.
Rule 15. EightOfSpades
When a player "plays" the card labelled {Eight, Spades}, then he/she must modify a rule. The game cannot continue until this is completed.
The server will only join a game if it has a "player" ID of zero. It will only participate in a shuffle if it is the first person to lock the cards. It will always agree with an EndGame command, i.e. the game can be ended by mutual consent at any time. The server will disagree with a command other than EndGame if one of its rules prohibits the command, and that rule is still in effect. It will also disagree if another command is still underway.
Two strings A and B are considered equivalent if and only if f(A) = f(B) where f(X) is derived from X using the following algorithm:
© Robert BL Sept18/00 18:36 MDT