trill


Nametrill JSON
Version 0.0.11 PyPI version JSON
download
home_pageNone
SummaryTroll language parser and interpreter.
upload_time2024-02-19 17:47:01
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseCopyright © 2022-2023 Greger Stolt Nilsen 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 dice interpreter troll
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Trill is a Troll interpreter

Implemented in Python both as a package and for command line use.

Troll is a dice roll language made by Torben Mogensen  
http://hjemmesider.diku.dk/~torbenm/Troll/

## Command line usage

Rolling a single die: `trill d12`

Rolling multiple die: `trill 3d6`

## Use from a python script

```
from trill import trill

result, errors = trill("3d6")
```

See further examples in the examples folder.


## Running tests

`make test`

## Running coverage

`make coverage`


## Development

Currently in a very early state.
Most of the notation is not yet implemented.
See the list below for what is, and what is not (supposed) to work yet.

### Notation

(From summary on quick reference http://hjemmesider.diku.dk/~torbenm/Troll/quickRef.html)

- [x] roll one dn (1 - n)
- [x] roll m dn
- [x] roll one zn (0 - n)
- [x] roll m zn
- [x] arithmetic on single value (+ - \* / mod)
- [x] _sgn_, sign of number
- [x] _sum_, add up values in collection
- [x] _count_ values in collection
- [x] Union of collections (U or @)
- [x] Union of elements { }
- [x] _min_ and _max_ in collection
- [x] all _minimal_ and all _maximal_ values in collection
- [x] _median_ value in collection
- [x] _least_ n and 
- [x] _largest_ n values in collection
- [x] m samples of e ( # )
- [x] range of values ( .. )
- [x] _choose_ value from collection
- [x] _pick_ n values from collection e
- [x] filters (< <= > >= = =/=)
- [x] _drop_ elements
- [x] _keep_ elements
- [x] multiset difference ( -- )
- [x] remove duplicates ( _different_ )
- [x] conditional ( if-then-else )
- [x] probability ( ?p )
- [x] logical and ( & )
- [x] logical not ( ! )
- [x] bind x to value of e1 in e2 ( _x := e1; e2_ )
- [x] _foreach x in e1 do e2_
- [x] _repeat x := e1 while/until e2_
- [x] _accumulate x := e1 while/until e2_
- [x] _function_
- [x] _compositional_
- [x] _call_
- [x] text box of single sample ( ' )
- [x] text box of n samples ( n ' )
- [x] combine text boxes horisontally ( || )
- [x] combine text boxes vertically, left-aligned ( |> )
- [x] combine text boxes vertically, right-aligned ( <| )
- [x] combine text boxes, centre-aligned ( <> )
- [x] Pair of e1,e2 ( [e1, e2])
- [x] First component of pair ( %1 )
- [x] Second component of pair ( %2 )
- [x] x~v returns value of x if x is defined, else returns v

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "trill",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "dice,interpreter,troll",
    "author": null,
    "author_email": "Greger Stolt Nilsen <gregersn@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/aa/8d/182d2b74dd441a2b10fff5c99d3b186f6b634b3d5b976ae00851b14f5507/trill-0.0.11.tar.gz",
    "platform": null,
    "description": "Trill is a Troll interpreter\n\nImplemented in Python both as a package and for command line use.\n\nTroll is a dice roll language made by Torben Mogensen  \nhttp://hjemmesider.diku.dk/~torbenm/Troll/\n\n## Command line usage\n\nRolling a single die: `trill d12`\n\nRolling multiple die: `trill 3d6`\n\n## Use from a python script\n\n```\nfrom trill import trill\n\nresult, errors = trill(\"3d6\")\n```\n\nSee further examples in the examples folder.\n\n\n## Running tests\n\n`make test`\n\n## Running coverage\n\n`make coverage`\n\n\n## Development\n\nCurrently in a very early state.\nMost of the notation is not yet implemented.\nSee the list below for what is, and what is not (supposed) to work yet.\n\n### Notation\n\n(From summary on quick reference http://hjemmesider.diku.dk/~torbenm/Troll/quickRef.html)\n\n- [x] roll one dn (1 - n)\n- [x] roll m dn\n- [x] roll one zn (0 - n)\n- [x] roll m zn\n- [x] arithmetic on single value (+ - \\* / mod)\n- [x] _sgn_, sign of number\n- [x] _sum_, add up values in collection\n- [x] _count_ values in collection\n- [x] Union of collections (U or @)\n- [x] Union of elements { }\n- [x] _min_ and _max_ in collection\n- [x] all _minimal_ and all _maximal_ values in collection\n- [x] _median_ value in collection\n- [x] _least_ n and \n- [x] _largest_ n values in collection\n- [x] m samples of e ( # )\n- [x] range of values ( .. )\n- [x] _choose_ value from collection\n- [x] _pick_ n values from collection e\n- [x] filters (< <= > >= = =/=)\n- [x] _drop_ elements\n- [x] _keep_ elements\n- [x] multiset difference ( -- )\n- [x] remove duplicates ( _different_ )\n- [x] conditional ( if-then-else )\n- [x] probability ( ?p )\n- [x] logical and ( & )\n- [x] logical not ( ! )\n- [x] bind x to value of e1 in e2 ( _x := e1; e2_ )\n- [x] _foreach x in e1 do e2_\n- [x] _repeat x := e1 while/until e2_\n- [x] _accumulate x := e1 while/until e2_\n- [x] _function_\n- [x] _compositional_\n- [x] _call_\n- [x] text box of single sample ( ' )\n- [x] text box of n samples ( n ' )\n- [x] combine text boxes horisontally ( || )\n- [x] combine text boxes vertically, left-aligned ( |> )\n- [x] combine text boxes vertically, right-aligned ( <| )\n- [x] combine text boxes, centre-aligned ( <> )\n- [x] Pair of e1,e2 ( [e1, e2])\n- [x] First component of pair ( %1 )\n- [x] Second component of pair ( %2 )\n- [x] x~v returns value of x if x is defined, else returns v\n",
    "bugtrack_url": null,
    "license": "Copyright \u00a9 2022-2023 Greger Stolt Nilsen\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), 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:\n        \n        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, 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": "Troll language parser and interpreter.",
    "version": "0.0.11",
    "project_urls": {
        "Homepage": "https://github.com/gregersn/Trill"
    },
    "split_keywords": [
        "dice",
        "interpreter",
        "troll"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "16a8ed24cff44621fbc02b76a616495c6af5a58be7e5f63bb79a80c2bcbf0841",
                "md5": "250ab48f61d6901fb510189b35e47750",
                "sha256": "704d3787c60799d13cea0423a6b05b9edb697a7f5c8a88d1db6573c799ab24d9"
            },
            "downloads": -1,
            "filename": "trill-0.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "250ab48f61d6901fb510189b35e47750",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 32023,
            "upload_time": "2024-02-19T17:47:00",
            "upload_time_iso_8601": "2024-02-19T17:47:00.439649Z",
            "url": "https://files.pythonhosted.org/packages/16/a8/ed24cff44621fbc02b76a616495c6af5a58be7e5f63bb79a80c2bcbf0841/trill-0.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "aa8d182d2b74dd441a2b10fff5c99d3b186f6b634b3d5b976ae00851b14f5507",
                "md5": "09d7925e02a9d6e4e699852909acf0b1",
                "sha256": "6799dfc4152d7c8b094764e4a9fc5d58346c45a43151185e1436f83e3794b618"
            },
            "downloads": -1,
            "filename": "trill-0.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "09d7925e02a9d6e4e699852909acf0b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 24580,
            "upload_time": "2024-02-19T17:47:01",
            "upload_time_iso_8601": "2024-02-19T17:47:01.519746Z",
            "url": "https://files.pythonhosted.org/packages/aa/8d/182d2b74dd441a2b10fff5c99d3b186f6b634b3d5b976ae00851b14f5507/trill-0.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-19 17:47:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gregersn",
    "github_project": "Trill",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "trill"
}
        
Elapsed time: 0.19045s