Giter Site home page Giter Site logo

Comments (4)

majuscule avatar majuscule commented on May 17, 2024

Hi @sdball!

Thanks for noting this issue. I've been taking a look at the the code, and I realized that the goodie has been case sensitive. The queries roll 4d6 - l and roll 3d12 - h do work. I've updated the goodie to trigger regardless of case - but it still doesn't seem to be doing quite what I expect. Since I am assuming it was working previously, and because I am unfamiliar with dice notation, I would appreciate you taking a second look checking the results.

Here's an example of what it's doing right now:

  You entered: roll 4d6 - L

DDG::ZeroClickInfo  {
    Parents       WWW::DuckDuckGo::ZeroClickInfo
    public methods (1) : new
    private methods (0)
    internals: {
        answer        "1 + 4 + 4 - 1 = 8 (random)",
        answer_type   "dice_roll",
        is_cached     0,
        is_unsafe     0
    }
}

That looks to me like 3 rolls, with the lowest subtracted, but I from what you've said, I would expect something like this (four rolls, minus the lowest):

  You entered: roll 4d6 - L

DDG::ZeroClickInfo  {
    Parents       WWW::DuckDuckGo::ZeroClickInfo
    public methods (1) : new
    private methods (0)
    internals: {
        answer        "1 + 4 + 4 + 3 - 1 = 11 (random)",
        answer_type   "dice_roll",
        is_cached     0,
        is_unsafe     0
    }
}

Can you confirm that in these cases we should be showing one more dice roll than we are? When you get back to me here, I'll make the fix, re-release and deploy.

Thanks!

from zeroclickinfo-goodies.

sdball avatar sdball commented on May 17, 2024

Sorry! I forgot that github doesn't email notifications anymore.

Yes, 4d6 - L says: roll 4 six-sided dice and subtract the lowest. That's definitely a bug. Instead of simply subtracting the lowest it should still be adding it and then subtracting it or just not even counting it.

roll 4d6 - l
5 + 5 + 6 - 3 = 13 (random) # should be 16
5 + 6 + 6 - 5 = 12 (random) # should be 17

from zeroclickinfo-goodies.

majuscule avatar majuscule commented on May 17, 2024

Hi again @sdball!

No problem :-) Although just to note - github does email me notifications. Perhaps it's a setting that's gotten disabled on your account?

Anyway, I see what you mean, and I've made the change in 21f4cbb. Additionally, I noticed that the way it was being done before was sorting the rolls before display. That didn't seem right to me, so I fixed that too. I also added a test case that should ensure that this error never comes up again.

Would you take a look and tell me what you think? If everything is right, I'll release the Goodies package and this will be deployed in a day or so.

Thanks again!

from zeroclickinfo-goodies.

majuscule avatar majuscule commented on May 17, 2024

Hi again,

It's been a while and this is now deployed. I'm closing the issue, but please feel free to reopen if you spot any other problems.

Thanks again!

from zeroclickinfo-goodies.

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.