Code Monkey home page Code Monkey logo

xdice's People

Contributors

jacobm001 avatar olinox14 avatar omassot avatar remillard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jacobm001

xdice's Issues

Breaking in later Python versions

I don't know exactly the cause, but I was tinkering with the package and going through your documented examples and ran across the following failure. I suspect it's due to using latest Python release if I had to guess, but I haven't dug into it any deeper than this.

λ python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xdice
>>> ps = xdice.roll("2d6+18")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\xdice.py", line 27, in roll
    return Pattern(pattern_string).roll()
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\xdice.py", line 318, in roll
    return PatternScore(self.format_string, scores)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\xdice.py", line 339, in __new__
    ps = super(PatternScore, cls).__new__(cls, _secured_eval(eval_string.format(*scores)))
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\xdice.py", line 40, in _secured_eval
    return eval(raw, {"__builtins__":None}, _ALLOWED)
  File "<string>", line 1
    <Score; score=10; detail=[5, 5]; dropped=[]; name=2d6>+18
    ^
SyntaxError: invalid syntax
>>>

Add fudge dice

Hey can you do this, please? :P
I would almost totally use your system then, because that dice pip package is so bad.

I mean something like
(f - fudge)
"1f10"
possible result: -10 to 10, i.e 7 0 2 -2 -6 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.