rich-life


Namerich-life JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryTerminal-based life and ant simulation.
upload_time2024-09-19 03:56:14
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2024 Paul Robello Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords simulation terminal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Conway's Game of Life and Langton's Ant


[![PyPI](https://img.shields.io/pypi/v/rich_life)](https://pypi.org/project/rich_life/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rich_life.svg)](https://pypi.org/project/rich_life/)  
![Runs on Linux | MacOS | Windows](https://img.shields.io/badge/runs%20on-Linux%20%7C%20MacOS%20%7C%20Windows-blue)
![Arch x86-63 | ARM | AppleSilicon](https://img.shields.io/badge/arch-x86--64%20%7C%20ARM%20%7C%20AppleSilicon-blue)  
![PyPI - License](https://img.shields.io/pypi/l/rich_life)

## About
This project implements Conway's Game of Life and Langton's Ant.  
Both are cellular automaton simulations.
Uses Rich for terminal visualization.

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/probello3)

## Screenshots
![Game of Life Screenshot](https://raw.githubusercontent.com/paulrobello/rich_life/main/life-screenshot.png)
![Langton's Ant Screenshot](https://raw.githubusercontent.com/paulrobello/rich_life/main/ants-screenshot.png)

## Installation

To install make sure you have Python 3.11 or higher and [uv](https://pypi.org/project/uv/) installed.

### Installation From Source

1. Clone the repository:
   ```bash
   git clone https://github.com/paulrobello/rich_life.git
   cd rich_life
   ```

2. Install the required dependencies:
   ```bash
   uv sync
   ```

### Installation From PyPI

To install from PyPI, run any of the following commands:

```bash
uv tool install rich-life
```

```bash
pipx install rich-life
```

## Usage

### Running if installed from PyPI
```bash
rich_life
```

### Running from source
Run the Game of Life simulation using the following command:

```bash
uv run rich_life
```

You can customize the grid size, number of generations, and neighborhood rules using command-line options:

```bash
uv run rich_life --width 50 --height 30 --generations 300 --rules moore
```

Run the Langton's Ant simulation using the following command:

```bash
uv run rich_life --mode ants
```


Available options:
- `--width` or `-w`: Width of the grid (default: half of console height)
- `--height` or `-h`: Height of the grid (default: half of console height minus 2)
- `--infinite` or `-i`: Enable infinite mode. Simulation grid has no bounds (default: False)
- `--generations` or `-g`: Number of generations to simulate (default: 100)
- `--mode` or `-m`: Simulation mode (options: 'life' or 'ants', default: 'ants')
- `--rules` or `-r`: Neighborhood rules for game of life (options: 'moore' or 'van_neumann', default: 'moore')
- `--offset-x` or `-x`: Bord display X-coordinate offset for infinite mode (default: 0)
- `--offset-y` or `-y`: Bord display Y-coordinate offset for infinite mode (default: 0)
- `--rps` or `-r`: Refresh / generations per second (default: 10)
- `--follow` or `-f`: Follow the ant in ANTS mode (default: False)


Keys:
- 'Arrows' / 'WSAD': Pan the grid

## Running Tests

To run the tests, use the following command:

```bash
uv run pytest tests/test_game_of_life.py
```

## What's New

- Version 0.3.0: Added follow mode for Langton's Ant
- Version 0.2.0: Better keyboard handling
- Version 0.1.0: Initial release

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is open source and available under the [MIT License](LICENSE).

## Author

Paul Robello (probello@gmail.com)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rich-life",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "Paul Robello <probello@gmail.com>",
    "keywords": "simulation, terminal",
    "author": null,
    "author_email": "Paul Robello <probello@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/63/6f/04e13700cfe15dd14f73f80deb0ca5aeab847da7471c4adde92c79412f77/rich_life-0.3.0.tar.gz",
    "platform": null,
    "description": "# Conway's Game of Life and Langton's Ant\n\n\n[![PyPI](https://img.shields.io/pypi/v/rich_life)](https://pypi.org/project/rich_life/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rich_life.svg)](https://pypi.org/project/rich_life/)  \n![Runs on Linux | MacOS | Windows](https://img.shields.io/badge/runs%20on-Linux%20%7C%20MacOS%20%7C%20Windows-blue)\n![Arch x86-63 | ARM | AppleSilicon](https://img.shields.io/badge/arch-x86--64%20%7C%20ARM%20%7C%20AppleSilicon-blue)  \n![PyPI - License](https://img.shields.io/pypi/l/rich_life)\n\n## About\nThis project implements Conway's Game of Life and Langton's Ant.  \nBoth are cellular automaton simulations.\nUses Rich for terminal visualization.\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/probello3)\n\n## Screenshots\n![Game of Life Screenshot](https://raw.githubusercontent.com/paulrobello/rich_life/main/life-screenshot.png)\n![Langton's Ant Screenshot](https://raw.githubusercontent.com/paulrobello/rich_life/main/ants-screenshot.png)\n\n## Installation\n\nTo install make sure you have Python 3.11 or higher and [uv](https://pypi.org/project/uv/) installed.\n\n### Installation From Source\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/paulrobello/rich_life.git\n   cd rich_life\n   ```\n\n2. Install the required dependencies:\n   ```bash\n   uv sync\n   ```\n\n### Installation From PyPI\n\nTo install from PyPI, run any of the following commands:\n\n```bash\nuv tool install rich-life\n```\n\n```bash\npipx install rich-life\n```\n\n## Usage\n\n### Running if installed from PyPI\n```bash\nrich_life\n```\n\n### Running from source\nRun the Game of Life simulation using the following command:\n\n```bash\nuv run rich_life\n```\n\nYou can customize the grid size, number of generations, and neighborhood rules using command-line options:\n\n```bash\nuv run rich_life --width 50 --height 30 --generations 300 --rules moore\n```\n\nRun the Langton's Ant simulation using the following command:\n\n```bash\nuv run rich_life --mode ants\n```\n\n\nAvailable options:\n- `--width` or `-w`: Width of the grid (default: half of console height)\n- `--height` or `-h`: Height of the grid (default: half of console height minus 2)\n- `--infinite` or `-i`: Enable infinite mode. Simulation grid has no bounds (default: False)\n- `--generations` or `-g`: Number of generations to simulate (default: 100)\n- `--mode` or `-m`: Simulation mode (options: 'life' or 'ants', default: 'ants')\n- `--rules` or `-r`: Neighborhood rules for game of life (options: 'moore' or 'van_neumann', default: 'moore')\n- `--offset-x` or `-x`: Bord display X-coordinate offset for infinite mode (default: 0)\n- `--offset-y` or `-y`: Bord display Y-coordinate offset for infinite mode (default: 0)\n- `--rps` or `-r`: Refresh / generations per second (default: 10)\n- `--follow` or `-f`: Follow the ant in ANTS mode (default: False)\n\n\nKeys:\n- 'Arrows' / 'WSAD': Pan the grid\n\n## Running Tests\n\nTo run the tests, use the following command:\n\n```bash\nuv run pytest tests/test_game_of_life.py\n```\n\n## What's New\n\n- Version 0.3.0: Added follow mode for Langton's Ant\n- Version 0.2.0: Better keyboard handling\n- Version 0.1.0: Initial release\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n\n## Author\n\nPaul Robello (probello@gmail.com)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Paul Robello  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Terminal-based life and ant simulation.",
    "version": "0.3.0",
    "project_urls": {
        "Discussions": "https://github.com/paulrobello/rich_life/discussions",
        "Documentation": "https://github.com/paulrobello/rich_life/blob/main/README.md",
        "Homepage": "https://github.com/paulrobello/rich_life",
        "Issues": "https://github.com/paulrobello/rich_life/issues",
        "Repository": "https://github.com/paulrobello/rich_life",
        "Wiki": "https://github.com/paulrobello/rich_life/wiki"
    },
    "split_keywords": [
        "simulation",
        " terminal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5616d6df9e3bc833ca98d07bd051a694a5bc5f2333d7c5ec215a0382b851aee1",
                "md5": "d0c20fac1b2932f8fbc28c145acb2f60",
                "sha256": "64c1708376f86d5ae2534cbedb917fba0c557ce894a4d338562ccbab8a89e317"
            },
            "downloads": -1,
            "filename": "rich_life-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d0c20fac1b2932f8fbc28c145acb2f60",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 8780,
            "upload_time": "2024-09-19T03:56:13",
            "upload_time_iso_8601": "2024-09-19T03:56:13.053745Z",
            "url": "https://files.pythonhosted.org/packages/56/16/d6df9e3bc833ca98d07bd051a694a5bc5f2333d7c5ec215a0382b851aee1/rich_life-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "636f04e13700cfe15dd14f73f80deb0ca5aeab847da7471c4adde92c79412f77",
                "md5": "1acb9065343b61027e686f731e519e4d",
                "sha256": "8fe2bdb0d1d2e1489b906a2f6bdfcb71a9f1d921febcb90b3cf8bb976a2b32fe"
            },
            "downloads": -1,
            "filename": "rich_life-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1acb9065343b61027e686f731e519e4d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 7879,
            "upload_time": "2024-09-19T03:56:14",
            "upload_time_iso_8601": "2024-09-19T03:56:14.256043Z",
            "url": "https://files.pythonhosted.org/packages/63/6f/04e13700cfe15dd14f73f80deb0ca5aeab847da7471c4adde92c79412f77/rich_life-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-19 03:56:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "paulrobello",
    "github_project": "rich_life",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rich-life"
}
        
Elapsed time: 0.38689s