Need help with AnyDice

Hey AnyDice experts, I’d like to create a function that does this:

Roll a number of d6s and d8s, keep the single highest, then add +1 to that result for each die that rolled its maximum value.

So, if I rolled 3d8 and 4d6 and got 3, 2, 8, 1, 4, 5, 6 the total result would be 10 (the 8, plus 2 for two max dice).

Can anyone write that up on anydice.com for me?

I’ll give it a shot, at least!

EDIT: Looks like AnyDice makes it a bit of a pain to work with pools. Mind if I hack something up in Python?

100k Monte Carlo trials (for 663,552 possible results), for what it’s worth:

~ [ ./pool.py 4d6+3d8 ] 3:19 PM
02: 0.00023
03: 0.00295
04: 0.02116
05: 0.09240
06: 0.17987
07: 0.21916
08: 0.25730
09: 0.16277
10: 0.05276
11: 0.01025
12: 0.00109
13: 0.00006

A million trials:

~ [ ./pool.py 4d6+3d8 ] 3:19 PM
01: 0.00000
02: 0.00019
03: 0.00320
04: 0.02142
05: 0.09312
06: 0.18023
07: 0.21586
08: 0.25889
09: 0.16188
10: 0.05373
11: 0.01033
12: 0.00107
13: 0.00007
14: 0.00000

See https://gist.github.com/blinks/3cbb0a74273ebcbc93f26572e2267793 for the code, to run locally.

3 Likes

Nice! Thank you, Adam!

2 Likes

I got a follow-up from the AnyDice creator, Jasper Flick. If anyone else needs this in the future:

https://anydice.com/program/16923

1 Like