cubescrambler


Namecubescrambler JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryA Python utility package for generating scrambles for twisty puzzles without non-python dependency
upload_time2023-05-10 16:25:28
maintainer
docs_urlNone
author
requires_python
licenseCopyright (c) 2018 The Python Packaging Authority Copyright (c) 2023 Márton Kónya 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 rubik cube scramble
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cubescrambler
A Python package for generating scrambles of various twisty puzzles, including the Rubik's cube, 4x4x4 cube, and others, based on [pyTwistyScrambler](https://github.com/euphwes/pyTwistyScrambler/).
Thanks to [csTimer](https://github.com/cs0x7f/cstimer) for providing the bulk of the Javascript scrambling source code around which this project is a wrapper.
And thanks for [pyTwistyScrambler](https://github.com/euphwes/pyTwistyScrambler/) for the base code this wrapper is built on.

## Reason
pyTwistyScrambler is using [PyExecJS](https://github.com/doloopwhile/PyExecJS) for executing the JavaScript but it's EOL and it needs nodejs or any other js runtime on the system. My version uses [dukpy](https://github.com/amol-/dukpy) which doesn't have any external dependencies and is actively maintained. There are no other changes besides removing FTO and rex puzzles because I didn't need them.

## Example usage

```python
from cubescrambler import scrambler333, scrambler222, scrambler444,\
	megaminxScrambler, squareOneScrambler

scrambler333.get_WCA_scramble()
# D2 L F2 L2 F2 U2 L D2 F2 L' B' U2 F2 D' F D2 B' U2 R U'

scrambler222.get_WCA_scramble()
# R' F2 U2 R' U R2 F' U' F' U'

scrambler444.get_WCA_scramble()
# L2 F D2 R U Fw' Uw D L F Rw D' F L2 F' Rw' F Uw B' F' L2 B' U' Rw' F B R' D U2 L2 Fw' B D' Rw' Uw' B' Fw' R2 L2 U

megaminxScrambler.get_WCA_scramble()
# R-- D-- R++ D++ R++ D++ R++ D++ R++ D++ U R-- D++ R-- D++ R-- D++ R-- D++ R-- D-- U' R-- D++ R-- D-- R-- D++ R-- D-- R-- D-- U' R++ D++ R-- D-- R++ D-- R-- D++ R-- D-- U' R-- D-- R++ D++ R++ D-- R++ D++ R++ D-- U' R-- D-- R++ D-- R++ D-- R++ D-- R++ D++ U R++ D-- R++ D-- R++ D++ R-- D-- R++ D++ U

squareOneScrambler.get_WCA_scramble()
# (0, -1)/(4, 1)/(-4, 5)/(0, -3)/(1, -2)/(3, 0)/(2, 0)/(0, -3)/(4, -3)/(0, -4)/(2, 0)/(5, -2)/(4, 0)
```

## What scrambles can be generated?
### 3x3x3 (Rubik's cube)
In `scrambler333` module:

- `get_WCA_scramble()`            random state scramble (WCA)
- `get_3BLD_scramble()`           BLD scramble
- `get_edges_scramble()`          edges-only
- `get_corners_scramble()`        corners-only
- `get_LL_scramble()`             LL (last layer)
- `get_F2L_scramble()`            F2L (first two layers)
- `get_easy_cross_scramble(n=4)`  easy cross (where cross can be solved in `n` moves)
- `get_LSLL_scramble()`           LSLL
- `get_ZBLL_scramble()`           ZBLL
- `get_ZZLL_scramble()`           ZZLL
- `get_ZBLS_scramble()`           ZBLS
- `get_LSE_scramble()`            LSE
- `get_CMLL_scramble()`           CMLL
- `get_CLL_scramble()`            CLL
- `get_ELL_scramble()`            ELL
- `get_EOLine_scramble()`         EO Line
- `get_2genRU_scramble()`         2-gen with RU moves
- `get_2genLU_scramble()`         2-gen with LU moves
- `get_2genMU_scramble()`         2-gen with MU moves
- `get_3genFRU_scramble()`        3-gen with FRU moves
- `get_3genRUL_scramble()`        3-gen with RUL moves
- `get_3genRrU_scramble()`        3-gen with RrU moves
- `get_half_turns_scramble()`     half-turns only

### 2x2x2
In `scrambler222` module:

- `get_WCA_scramble()`            random scramble (WCA)
- `get_optimal_scramble()`        optimal random state scramble

### 4x4x4
In `scrambler444` module:

- `get_WCA_scramble()`              random scramble (WCA) (note: this is **slow**)
- `get_4BLD_scramble(n=40)`         alias of `get_random_state_scramble(n=40)`
- `get_SiGN_scramble(n=40)`         SiGN-notation scramble of length `n`
- `get_random_state_scramble(n=40)` random state scramble of length `n`
- `get_edges_scramble(n=8)`         edges scramble

### 5x5x5
In `scrambler555` module:

- `get_WCA_scramble(n=60)`        random scramble (WCA) of length `n`
- `get_5BLD_scramble(n=60)`       alias of `get_WCA_scramble`
- `get_SiGN_scramble(n=60)`       SiGN-notation scramble of length `n`
- `get_edges_scramble(n=8)`       edges scramble

### 6x6x6
In `scrambler666` module:

- `get_WCA_scramble(n=80)`        random scramble (WCA) of length `n`
- `get_SiGN_scramble(n=80)`       SiGN-notation scramble of length `n`
- `get_edges_scramble(n=8)`       edges scramble

### 7x7x7
In `scrambler777` module:

- `get_WCA_scramble(n=100)`       random scramble (WCA) of length `n`
- `get_SiGN_scramble(n=100)`      SiGN-notation scramble of length `n`
- `get_edges_scramble(n=8)`       edges scramble

### Pyraminx
In `pyraminxScrambler` module:

- `get_WCA_scramble()`            random scramble (WCA)
- `get_optimal_scramble()`        optimal random state scramble

### Megaminx
In `megaminxScrambler` module:

- `get_WCA_scramble(n=70)`        random scramble (WCA) of length `n`
- `get_Carrot_scramble(n=70)`     Carrot-notation scramble of length `n`
- `get_old_style_scramble(n=70)`  old-style scramble of length `n`

### Square-1
In `squareOneScrambler` module:

- `get_WCA_scramble()`                      random scramble (WCA)
- `get_face_turn_metric_scramble(n=40)`     face-turn metric scramble of length `n`
- `get_twist_metric_scramble(n=20)`         twist metric scramble of length `n`

### Skewb
In `skewbScrambler` module:

- `get_WCA_scramble()`      random scramble (WCA)
- `get_ULRB_scramble()`     ULRB scramble

### Clock
In `clockScrambler` module:

- `get_WCA_scramble()`                   Clock scramble (WCA notation)
- `get_Jaap_scramble()`                  Clock scramble (Jaap notation)
- `get_concise_scramble()`               Clock scramble (concise notation)
- `get_efficient_pin_order_scramble()`   Clock scramble (efficient pin order notation)

### Big cubes
In `bigCubesScrambler` module:

- `get_8x8x8_scrambler(n=120)`        8x8x8 scramble (SiGN notation) of length `n`
- `get_9x9x9_scrambler(n=120)`        9x9x9 scramble (SiGN notation) of length `n`
- `get_10x10x10_scrambler(n=120)`     10x10x10 scramble (SiGN notation) of length `n`
- `get_11x11x11_scrambler(n=120)`     11x11x11 scramble (SiGN notation) of length `n`

### Cuboids
In `cuboidsScrambler` module:

- `get_1x1x2_scramble()`              1x1x2 cuboid scramble
- `get_1x3x3_scramble()`              1x3x3 cuboid (floppy cube) scramble
- `get_floppy_cube_scramble()`        alias of `get_1x3x3_scramble()`
- `get_super_floppy_cube_scramble()`  1x3x3 cuboid (super floppy cube) scramble
- `get_2x2x3_scramble()`              2x2x3 cuboid scramble
- `get_3x3x2_scramble()`              3x3x2 cuboid scramble
- `get_3x3x4_scramble()`              3x3x4 cuboid scramble
- `get_3x3x5_scramble(n=25)`          3x3x5 cuboid scramble, where `n` is the length of the non-3x3 portion of the scramble
- `get_3x3x6_scramble()`              3x3x6 cuboid scramble
- `get_3x3x7_scramble(n=40)`          3x3x7 cuboid scramble, where `n` is the length of the non-3x3 portion of the scramble
  
## Copyright Notice

This software includes third party open source software components: [pyTwistyScrambler](https://github.com/euphwes/pyTwistyScrambler/) from [euphwes](https://github.com/euphwes) and [csTimer](https://github.com/cs0x7f/cstimer) from [cs0x7f](https://github.com/cs0x7f). Each of these software components have their own license. Please see ./LICENSE, and ./cubescrambler/js_resources/LICENSE.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cubescrambler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "rubik,cube,scramble",
    "author": "",
    "author_email": "M\u00e1rton K\u00f3nya <konyamarci52@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/9d/b0/e1cd23a1f14270cb57a56b16a35b761994391e96b822dacb5266895b9859/cubescrambler-1.0.0.tar.gz",
    "platform": null,
    "description": "# cubescrambler\nA Python package for generating scrambles of various twisty puzzles, including the Rubik's cube, 4x4x4 cube, and others, based on [pyTwistyScrambler](https://github.com/euphwes/pyTwistyScrambler/).\nThanks to [csTimer](https://github.com/cs0x7f/cstimer) for providing the bulk of the Javascript scrambling source code around which this project is a wrapper.\nAnd thanks for [pyTwistyScrambler](https://github.com/euphwes/pyTwistyScrambler/) for the base code this wrapper is built on.\n\n## Reason\npyTwistyScrambler is using [PyExecJS](https://github.com/doloopwhile/PyExecJS) for executing the JavaScript but it's EOL and it needs nodejs or any other js runtime on the system. My version uses [dukpy](https://github.com/amol-/dukpy) which doesn't have any external dependencies and is actively maintained. There are no other changes besides removing FTO and rex puzzles because I didn't need them.\n\n## Example usage\n\n```python\nfrom cubescrambler import scrambler333, scrambler222, scrambler444,\\\n\tmegaminxScrambler, squareOneScrambler\n\nscrambler333.get_WCA_scramble()\n# D2 L F2 L2 F2 U2 L D2 F2 L' B' U2 F2 D' F D2 B' U2 R U'\n\nscrambler222.get_WCA_scramble()\n# R' F2 U2 R' U R2 F' U' F' U'\n\nscrambler444.get_WCA_scramble()\n# L2 F D2 R U Fw' Uw D L F Rw D' F L2 F' Rw' F Uw B' F' L2 B' U' Rw' F B R' D U2 L2 Fw' B D' Rw' Uw' B' Fw' R2 L2 U\n\nmegaminxScrambler.get_WCA_scramble()\n# R-- D-- R++ D++ R++ D++ R++ D++ R++ D++ U R-- D++ R-- D++ R-- D++ R-- D++ R-- D-- U' R-- D++ R-- D-- R-- D++ R-- D-- R-- D-- U' R++ D++ R-- D-- R++ D-- R-- D++ R-- D-- U' R-- D-- R++ D++ R++ D-- R++ D++ R++ D-- U' R-- D-- R++ D-- R++ D-- R++ D-- R++ D++ U R++ D-- R++ D-- R++ D++ R-- D-- R++ D++ U\n\nsquareOneScrambler.get_WCA_scramble()\n# (0, -1)/(4, 1)/(-4, 5)/(0, -3)/(1, -2)/(3, 0)/(2, 0)/(0, -3)/(4, -3)/(0, -4)/(2, 0)/(5, -2)/(4, 0)\n```\n\n## What scrambles can be generated?\n### 3x3x3 (Rubik's cube)\nIn `scrambler333` module:\n\n- `get_WCA_scramble()`            random state scramble (WCA)\n- `get_3BLD_scramble()`           BLD scramble\n- `get_edges_scramble()`          edges-only\n- `get_corners_scramble()`        corners-only\n- `get_LL_scramble()`             LL (last layer)\n- `get_F2L_scramble()`            F2L (first two layers)\n- `get_easy_cross_scramble(n=4)`  easy cross (where cross can be solved in `n` moves)\n- `get_LSLL_scramble()`           LSLL\n- `get_ZBLL_scramble()`           ZBLL\n- `get_ZZLL_scramble()`           ZZLL\n- `get_ZBLS_scramble()`           ZBLS\n- `get_LSE_scramble()`            LSE\n- `get_CMLL_scramble()`           CMLL\n- `get_CLL_scramble()`            CLL\n- `get_ELL_scramble()`            ELL\n- `get_EOLine_scramble()`         EO Line\n- `get_2genRU_scramble()`         2-gen with RU moves\n- `get_2genLU_scramble()`         2-gen with LU moves\n- `get_2genMU_scramble()`         2-gen with MU moves\n- `get_3genFRU_scramble()`        3-gen with FRU moves\n- `get_3genRUL_scramble()`        3-gen with RUL moves\n- `get_3genRrU_scramble()`        3-gen with RrU moves\n- `get_half_turns_scramble()`     half-turns only\n\n### 2x2x2\nIn `scrambler222` module:\n\n- `get_WCA_scramble()`            random scramble (WCA)\n- `get_optimal_scramble()`        optimal random state scramble\n\n### 4x4x4\nIn `scrambler444` module:\n\n- `get_WCA_scramble()`              random scramble (WCA) (note: this is **slow**)\n- `get_4BLD_scramble(n=40)`         alias of `get_random_state_scramble(n=40)`\n- `get_SiGN_scramble(n=40)`         SiGN-notation scramble of length `n`\n- `get_random_state_scramble(n=40)` random state scramble of length `n`\n- `get_edges_scramble(n=8)`         edges scramble\n\n### 5x5x5\nIn `scrambler555` module:\n\n- `get_WCA_scramble(n=60)`        random scramble (WCA) of length `n`\n- `get_5BLD_scramble(n=60)`       alias of `get_WCA_scramble`\n- `get_SiGN_scramble(n=60)`       SiGN-notation scramble of length `n`\n- `get_edges_scramble(n=8)`       edges scramble\n\n### 6x6x6\nIn `scrambler666` module:\n\n- `get_WCA_scramble(n=80)`        random scramble (WCA) of length `n`\n- `get_SiGN_scramble(n=80)`       SiGN-notation scramble of length `n`\n- `get_edges_scramble(n=8)`       edges scramble\n\n### 7x7x7\nIn `scrambler777` module:\n\n- `get_WCA_scramble(n=100)`       random scramble (WCA) of length `n`\n- `get_SiGN_scramble(n=100)`      SiGN-notation scramble of length `n`\n- `get_edges_scramble(n=8)`       edges scramble\n\n### Pyraminx\nIn `pyraminxScrambler` module:\n\n- `get_WCA_scramble()`            random scramble (WCA)\n- `get_optimal_scramble()`        optimal random state scramble\n\n### Megaminx\nIn `megaminxScrambler` module:\n\n- `get_WCA_scramble(n=70)`        random scramble (WCA) of length `n`\n- `get_Carrot_scramble(n=70)`     Carrot-notation scramble of length `n`\n- `get_old_style_scramble(n=70)`  old-style scramble of length `n`\n\n### Square-1\nIn `squareOneScrambler` module:\n\n- `get_WCA_scramble()`                      random scramble (WCA)\n- `get_face_turn_metric_scramble(n=40)`     face-turn metric scramble of length `n`\n- `get_twist_metric_scramble(n=20)`         twist metric scramble of length `n`\n\n### Skewb\nIn `skewbScrambler` module:\n\n- `get_WCA_scramble()`      random scramble (WCA)\n- `get_ULRB_scramble()`     ULRB scramble\n\n### Clock\nIn `clockScrambler` module:\n\n- `get_WCA_scramble()`                   Clock scramble (WCA notation)\n- `get_Jaap_scramble()`                  Clock scramble (Jaap notation)\n- `get_concise_scramble()`               Clock scramble (concise notation)\n- `get_efficient_pin_order_scramble()`   Clock scramble (efficient pin order notation)\n\n### Big cubes\nIn `bigCubesScrambler` module:\n\n- `get_8x8x8_scrambler(n=120)`        8x8x8 scramble (SiGN notation) of length `n`\n- `get_9x9x9_scrambler(n=120)`        9x9x9 scramble (SiGN notation) of length `n`\n- `get_10x10x10_scrambler(n=120)`     10x10x10 scramble (SiGN notation) of length `n`\n- `get_11x11x11_scrambler(n=120)`     11x11x11 scramble (SiGN notation) of length `n`\n\n### Cuboids\nIn `cuboidsScrambler` module:\n\n- `get_1x1x2_scramble()`              1x1x2 cuboid scramble\n- `get_1x3x3_scramble()`              1x3x3 cuboid (floppy cube) scramble\n- `get_floppy_cube_scramble()`        alias of `get_1x3x3_scramble()`\n- `get_super_floppy_cube_scramble()`  1x3x3 cuboid (super floppy cube) scramble\n- `get_2x2x3_scramble()`              2x2x3 cuboid scramble\n- `get_3x3x2_scramble()`              3x3x2 cuboid scramble\n- `get_3x3x4_scramble()`              3x3x4 cuboid scramble\n- `get_3x3x5_scramble(n=25)`          3x3x5 cuboid scramble, where `n` is the length of the non-3x3 portion of the scramble\n- `get_3x3x6_scramble()`              3x3x6 cuboid scramble\n- `get_3x3x7_scramble(n=40)`          3x3x7 cuboid scramble, where `n` is the length of the non-3x3 portion of the scramble\n  \n## Copyright Notice\n\nThis software includes third party open source software components: [pyTwistyScrambler](https://github.com/euphwes/pyTwistyScrambler/) from [euphwes](https://github.com/euphwes) and [csTimer](https://github.com/cs0x7f/cstimer) from [cs0x7f](https://github.com/cs0x7f). Each of these software components have their own license. Please see ./LICENSE, and ./cubescrambler/js_resources/LICENSE.\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2018 The Python Packaging Authority Copyright (c) 2023 M\u00e1rton K\u00f3nya  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": "A Python utility package for generating scrambles for twisty puzzles without non-python dependency",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/koma52/cubescrambler"
    },
    "split_keywords": [
        "rubik",
        "cube",
        "scramble"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "287f9c8d4c8dce06e052ae4f384bc66581c176d9fcad4d7846b02867911c4a6b",
                "md5": "b6c645c7ee9fdb9ff4646b177084e20e",
                "sha256": "d7a73884eb9695f5871e423d0880dd74364193fe9ae1de8343e61a0d12148160"
            },
            "downloads": -1,
            "filename": "cubescrambler-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b6c645c7ee9fdb9ff4646b177084e20e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 61053,
            "upload_time": "2023-05-10T16:25:25",
            "upload_time_iso_8601": "2023-05-10T16:25:25.601784Z",
            "url": "https://files.pythonhosted.org/packages/28/7f/9c8d4c8dce06e052ae4f384bc66581c176d9fcad4d7846b02867911c4a6b/cubescrambler-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9db0e1cd23a1f14270cb57a56b16a35b761994391e96b822dacb5266895b9859",
                "md5": "dcb63c3d6f9dcf1f422a20751635b950",
                "sha256": "54bf0ce3f9b86af58b25857a32ed2ad3096cae2d18340b9ad2c4e4abfb82c8b7"
            },
            "downloads": -1,
            "filename": "cubescrambler-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "dcb63c3d6f9dcf1f422a20751635b950",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 55445,
            "upload_time": "2023-05-10T16:25:28",
            "upload_time_iso_8601": "2023-05-10T16:25:28.889110Z",
            "url": "https://files.pythonhosted.org/packages/9d/b0/e1cd23a1f14270cb57a56b16a35b761994391e96b822dacb5266895b9859/cubescrambler-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-10 16:25:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "koma52",
    "github_project": "cubescrambler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cubescrambler"
}
        
Elapsed time: 0.16683s