rushcards


Namerushcards JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA Python command line application for generating Rush Hour puzzle cards.
upload_time2024-05-08 07:47:07
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseNone
keywords games rush rush-hour
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Rush Cards

![Sample Rush Cards puzzle](https://raw.githubusercontent.com/marfire/rushcards/main/docs/images/sample.png)

Rush Cards provides a Python command line application for generating puzzle cards 
for the game [Rush Hour](https://en.wikipedia.org/wiki/Rush_Hour_(puzzle)). It 
    builds on [a project](https://www.michaelfogleman.com/rush/) by Michael Fogleman to 
identify all possible Rush Hour puzzles. Put simply, this project takes that 
database of puzzles, keeps the puzzles that can be expressed in the standard board 
game, maps a 1-10 difficulty scale onto them, and provides an interface to generate 
endless puzzle cards.

## Installation

Make sure you have [Python](https://www.python.org/downloads/) installed. Then run:

    $ pip install rushcards

## Usage

Cards are generated from the command line using either `rushcards` or `python -m 
rushcards`.

    $ rushcards 5

This will generate a single card representing a random puzzle of difficulty `5`, save 
the PNG image to a temporary directory, then open it in a native image-viewing 
application.

In addition to numbers `1` through `10` you can also specify `_` (underscore) to 
choose a random difficulty.

To put multiple cards into the same image use a comma-separated list of difficulties.

    $ # Create a single image with 6 puzzles in a 2x3 layout.
    $ rushcards 2,_,4,5,6,10

A compact layout will be chosen automatically, but you can also specify the layout 
with the `--layout` option.

    $ # Create an image with 6 rows of 1 puzzle each.
    $ rushcards 2,_,4,5,6,10 --layout 6x1

Regardless of how the layout is chosen, enough puzzles will be generated to 
completely fill it. This is done by repeating the sequence of difficulties as many 
times as necessary.

    $ # Create an image with 8 puzzles alternating between difficulties 2 and 3.
    $ rushcards 2,3 --layout 2x4

Use the `--outfile` option to specify an output file.

    $ # Save the image to a file.
    $ rushcards 5 --outfile puzzle.png

Specify the file as `-` (hyphen) to output to `stdout`.

    $ # Send the image to stdout and pipe it to another program.
    $ rushcards 5 --outfile - | wc -c
    7987

Note that when writing to `stdout` the image can't be opened automatically. You can 
also manually suppress opening the file with the `--no-open` option.

    $ # Write the puzzle to a file but don't open it.
    $ rushcards 5 --outfile puzzle.png --no-open

## Notes

The puzzle cards do not show solutions. The puzzle database doesn't include them, 
and in any case they aren't really necessary to enjoy the game.

The pixel size of the PNG image is fixed to a fairly arbitrary value since image 
viewing applications all have the ability to scale as needed for viewing or printing.

This package also includes the `mkpuzzles` tool (invoked with 
`python -m rushcards.tools.mkpuzzles`). This was used to filter the original Rush Hour 
puzzle database, assign difficulties, and save the data for later use with the 
`rushcards` application.

In total the program can generate 443,266 distinct puzzles.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rushcards",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "games, rush, rush-hour",
    "author": null,
    "author_email": "Kevin Christopher Henry <k@severian.com>",
    "download_url": "https://files.pythonhosted.org/packages/ac/d5/08a6c654c25af2a0fd6f4a2295b5ce91eed6123f88fc732431847c5ca47d/rushcards-0.2.0.tar.gz",
    "platform": null,
    "description": "# Rush Cards\n\n![Sample Rush Cards puzzle](https://raw.githubusercontent.com/marfire/rushcards/main/docs/images/sample.png)\n\nRush Cards provides a Python command line application for generating puzzle cards \nfor the game [Rush Hour](https://en.wikipedia.org/wiki/Rush_Hour_(puzzle)). It \n    builds on [a project](https://www.michaelfogleman.com/rush/) by Michael Fogleman to \nidentify all possible Rush Hour puzzles. Put simply, this project takes that \ndatabase of puzzles, keeps the puzzles that can be expressed in the standard board \ngame, maps a 1-10 difficulty scale onto them, and provides an interface to generate \nendless puzzle cards.\n\n## Installation\n\nMake sure you have [Python](https://www.python.org/downloads/) installed. Then run:\n\n    $ pip install rushcards\n\n## Usage\n\nCards are generated from the command line using either `rushcards` or `python -m \nrushcards`.\n\n    $ rushcards 5\n\nThis will generate a single card representing a random puzzle of difficulty `5`, save \nthe PNG image to a temporary directory, then open it in a native image-viewing \napplication.\n\nIn addition to numbers `1` through `10` you can also specify `_` (underscore) to \nchoose a random difficulty.\n\nTo put multiple cards into the same image use a comma-separated list of difficulties.\n\n    $ # Create a single image with 6 puzzles in a 2x3 layout.\n    $ rushcards 2,_,4,5,6,10\n\nA compact layout will be chosen automatically, but you can also specify the layout \nwith the `--layout` option.\n\n    $ # Create an image with 6 rows of 1 puzzle each.\n    $ rushcards 2,_,4,5,6,10 --layout 6x1\n\nRegardless of how the layout is chosen, enough puzzles will be generated to \ncompletely fill it. This is done by repeating the sequence of difficulties as many \ntimes as necessary.\n\n    $ # Create an image with 8 puzzles alternating between difficulties 2 and 3.\n    $ rushcards 2,3 --layout 2x4\n\nUse the `--outfile` option to specify an output file.\n\n    $ # Save the image to a file.\n    $ rushcards 5 --outfile puzzle.png\n\nSpecify the file as `-` (hyphen) to output to `stdout`.\n\n    $ # Send the image to stdout and pipe it to another program.\n    $ rushcards 5 --outfile - | wc -c\n    7987\n\nNote that when writing to `stdout` the image can't be opened automatically. You can \nalso manually suppress opening the file with the `--no-open` option.\n\n    $ # Write the puzzle to a file but don't open it.\n    $ rushcards 5 --outfile puzzle.png --no-open\n\n## Notes\n\nThe puzzle cards do not show solutions. The puzzle database doesn't include them, \nand in any case they aren't really necessary to enjoy the game.\n\nThe pixel size of the PNG image is fixed to a fairly arbitrary value since image \nviewing applications all have the ability to scale as needed for viewing or printing.\n\nThis package also includes the `mkpuzzles` tool (invoked with \n`python -m rushcards.tools.mkpuzzles`). This was used to filter the original Rush Hour \npuzzle database, assign difficulties, and save the data for later use with the \n`rushcards` application.\n\nIn total the program can generate 443,266 distinct puzzles.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python command line application for generating Rush Hour puzzle cards.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/marfire/rushcards",
        "Issues": "https://github.com/marfire/rushcards/issues"
    },
    "split_keywords": [
        "games",
        " rush",
        " rush-hour"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "084067085453f7302bdb24ea97b81bebf395a972318b483f462bb46f0510b2be",
                "md5": "c9e5be71fd98f97b376188fd9b76da55",
                "sha256": "1fb3b9e4e8a12c1067deae91c63f6594be393280bc977dcc7bb2d19cc8c665ff"
            },
            "downloads": -1,
            "filename": "rushcards-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9e5be71fd98f97b376188fd9b76da55",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5705385,
            "upload_time": "2024-05-08T07:47:11",
            "upload_time_iso_8601": "2024-05-08T07:47:11.760159Z",
            "url": "https://files.pythonhosted.org/packages/08/40/67085453f7302bdb24ea97b81bebf395a972318b483f462bb46f0510b2be/rushcards-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "acd508a6c654c25af2a0fd6f4a2295b5ce91eed6123f88fc732431847c5ca47d",
                "md5": "d69fef8ec4eacb2276b318c1cd760542",
                "sha256": "6abb9eab6b8cc4ed9d3dfa3149fb0fe4574b89a0025daec5e2477eff2049f2b0"
            },
            "downloads": -1,
            "filename": "rushcards-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d69fef8ec4eacb2276b318c1cd760542",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5559093,
            "upload_time": "2024-05-08T07:47:07",
            "upload_time_iso_8601": "2024-05-08T07:47:07.872330Z",
            "url": "https://files.pythonhosted.org/packages/ac/d5/08a6c654c25af2a0fd6f4a2295b5ce91eed6123f88fc732431847c5ca47d/rushcards-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 07:47:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "marfire",
    "github_project": "rushcards",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "rushcards"
}
        
Elapsed time: 0.36804s