Skip to main content
added 1 character in body
Source Link
HighDiceRoller
  • 7k
  • 1
  • 21
  • 43

Calling your function correctly

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as d121d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.

Icepool

If, similar to your previous question, you do indeed want to roll up to five dice, my Icepool Python probability package has a more efficient algorithm in this case as well.

from icepool import d, highest

output(highest(d(4).explode(),
               d(6).explode(),
               d(8).explode(),
               d(10).explode(),
               d(12).explode(),
               keep=2))

You can try this in your browser here.

Calling your function correctly

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.

Icepool

If, similar to your previous question, you do indeed want to roll up to five dice, my Icepool Python probability package has a more efficient algorithm in this case as well.

from icepool import d, highest

output(highest(d(4).explode(),
               d(6).explode(),
               d(8).explode(),
               d(10).explode(),
               d(12).explode(),
               keep=2))

You can try this in your browser here.

Calling your function correctly

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as 1d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.

Icepool

If, similar to your previous question, you do indeed want to roll up to five dice, my Icepool Python probability package has a more efficient algorithm in this case as well.

from icepool import d, highest

output(highest(d(4).explode(),
               d(6).explode(),
               d(8).explode(),
               d(10).explode(),
               d(12).explode(),
               keep=2))

You can try this in your browser here.

added 827 characters in body
Source Link
HighDiceRoller
  • 7k
  • 1
  • 21
  • 43

Calling your function correctly

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.

Icepool

If, similar to your previous question, you do indeed want to roll up to five dice, my Icepool Python probability package has a more efficient algorithm in this case as well.

from icepool import d, highest

output(highest(d(4).explode(),
               d(6).explode(),
               d(8).explode(),
               d(10).explode(),
               d(12).explode(),
               keep=2))

You can try this in your browser here.

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.

Calling your function correctly

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.

Icepool

If, similar to your previous question, you do indeed want to roll up to five dice, my Icepool Python probability package has a more efficient algorithm in this case as well.

from icepool import d, highest

output(highest(d(4).explode(),
               d(6).explode(),
               d(8).explode(),
               d(10).explode(),
               d(12).explode(),
               keep=2))

You can try this in your browser here.

Source Link
HighDiceRoller
  • 7k
  • 1
  • 21
  • 43

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.