-
Notifications
You must be signed in to change notification settings - Fork 1.8k
"roll 4d6 - L" is no longer showing results from dice.pm #198
Comments
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 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! |
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.
|
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! |
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! |
Aww, one of my favorite goodies I worked on back in the day is no longer handling one of its special cases. The code for -L and -H is still in dice.pm but it must no longer be matching its execution pattern correctly.
The deal is to have the dice goodie respond to standard dice notation:
The text was updated successfully, but these errors were encountered: