Login or Register
Admin Panel
Create Game
Manage Users
All User Sandboxes
Personal Sandbox
Multiplayer Games
Rules
Game State
Nomic
Nomic is a game in which the rules of the game can be changed as part of the gameplay. It was invented by philosopher Peter Suber, and its gameplay demonstrates that in any system with the power to change its own laws, a situation may arise where the laws become paradoxical or self-contradictory.
PyNomic
PyNomic is a Python-based version of Nomic where the game's rules are live, executable code. Gameplay revolves around modifying the game itself by proposing changes directly to its source code. Crucially, this power of self-amendment extends to everything, including the very rules that control how players vote on and pass new proposals, making every aspect of the game mutable.
Game API Reference
The following functions and variables are available to be used within the game rules:
game_state
: A dictionary containing all persistent data about the current game, like scores and player lists. This is saved to the database at the end of a successful turn.game_state['player_can_move']
: A list of players who are able to move. The server will allow any of these players to execute Rule 0. No other player may start a turn during another player's turn.rules
: A dictionary where keys are integer rule IDs and values are the Python code for that rule. Changes to this dictionary are saved at the end of a successful turn.rules[0]
will be run as the entry point of every turn.print(message, code=False)
: Prints output to the game's terminal. Ifcode=True
, the output will be formatted and highlighted as a Python code block.input(prompt, multi_line=False)
: Prompts the current player for input. Ifmulti_line
isFalse
(the default), it shows a single-line input box and submits on "Enter". IfTrue
, it shows a larger textarea with a submit button.end_turn()
: Immediately and successfully ends the current player's turn. Any changes made togame_state
orrules
will be saved.end_game(winners=[])
: Immediately ends the entire game. Any changes made togame_state
orrules
will be saved. The `winners` parameter should be a list of winning player names (e.g.,['Player1']
) or an empty list `[]` for a draw.sys.exit()
: Immediately cancels the current player's turn. **No changes togame_state
orrules
will be saved.** This is useful for aborting a turn after an invalid player input.
Initial Ruleset
Loading...