Giter VIP home page Giter VIP logo

Comments (2)

obiwankennedy avatar obiwankennedy commented on August 19, 2024

Hi,

Thanks for the report.
My answer is in English, as you can see :-).
It may help more people this way.

I explain the @ operator in the documentation of DiceParser (helpMe.md file).
The command segfault because you don't have two results in the execution tree.

DiceParser builds execution tree and run it.
In your example, the execution tree is made of:
Number Node (8) -> DiceRollingNode (D20) -> scalar operator node(+) -> NULL
-> Number Node (10) -> scalar operator node(*) -> NULL

-> Number Node (10) -> scalar operator node(*) ->
-> jumping backward @ -> countingNode (=20)

(Scalar operator has two children the next node and the internal node).

The jumping backward operator tries to reverse browser the tree to find the second dice result. It will not return the first result but the second one. Returning the first previous result is the normal behaviour (without the @).
So, the command will never work. I will fix the bug to prevent the segfault, but It will display error message.


I plan to implement a if operator, to execute any command if the condition is true.

The command will be 1d20i20{+10}, something like that.
in {}, it will be possible to add command to modify the result, or to run another command. As in warhammer (v2):
Assuming 46 is the value of the skill.

1d100i[<46]{1d10i10{1d100i[<46]{10+1d10e10}}}

Roll 1d100 if lesser than 46, then roll damage : 1d10.
If the damage roll gives 10, so roll again the skill test to check if the critical is confirmed.
If the critical is confirmed, run 10+1d10e10. It will give the final damage result.
I plan to do something like that.
It will allow combination of several dice, the main technical issue is to know what to display to the user.

from diceparser.

robinmoussu avatar robinmoussu commented on August 19, 2024

thanks for the quick fix :)

from diceparser.

Related Issues (20)

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.