Skip to content

Astera-org/nomic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nomic

Unit Tests Static Analysis Integration Tests License: MIT Python 3.8+

A game where players can change the rules of the game itself.

Game Creator's Site

About This Game

This repository contains the rules, procedures, and player data for a Nomic game. Players take turns proposing rule changes, which are voted on by all active players. The first player to reach 100 points wins.

Setup

Installation

  1. Install dependencies using uv (recommended) or pip:

    uv sync
    # or
    pip install -e .
  2. Configure game paths (optional):

    • Copy .env.example to .env if you need to customize file paths
    • By default, the game looks for files in the game/ directory

Development Setup

Install development dependencies:

uv sync --dev
# or
pip install -e ".[dev]"

Run tests:

# Unit tests (Python/pytest)
pytest

# Integration tests (Bash scripts)
./tests/integration/test_game_workflows.sh

CLI Usage

The nomic command provides a unified interface for managing the game. Here are some common examples:

# Player management
nomic players add "John Doe"
nomic players active
nomic players leaderboard
nomic players forfeit --player "John Doe"  # Forfeit game (Rule 113)

# Proposal management
nomic proposals add "John Doe" enactment
nomic proposals vote-interactive --proposal 301
nomic proposals resolve

# Game flow
nomic game turn

# Rules and queries
nomic rules get 201
nomic rules num

For detailed CLI documentation and examples, see the Game State Management Guide.

Configuration

Use the --env flag to specify a custom .env file:

nomic --env /path/to/.env rules num

Game Files

  • Rules - The current set of immutable and mutable rules, including all adopted rule changes
  • Player Metadata - Current player roster with scores and active status

How to Play

  1. Active players take turns proposing rule changes
  2. All active players vote on each proposal
  3. Proposals are adopted or rejected based on voting rules
  4. Scores are updated after voting closes

Current Status

See the rules file for the current set of rules and the player metadata file for the current list of players, their scores, and who the active player is.

Documentation

Comprehensive documentation is available in the docs/ directory:

Troubleshooting

Common Issues

  • "No proposals found": Ensure proposal files exist in the game directory
  • "Player not found": Check that player names match exactly (case-insensitive)
  • "Rule already exists": Each rule number must be unique
  • "Invalid proposal": Check that proposal follows game rules (e.g., immutable rules can only be transmuted)

Error Messages

The CLI provides clear error messages for common issues. All errors are logged with context to help diagnose problems.

For detailed troubleshooting and workflow examples, see the Game State Management Guide.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.4%
  • Shell 18.6%