Anydice: Reroll the lowest of 3d10 and keep the middle one

anydice

In a game I'm designing, usually you roll 3d10 and then keep the middle value. Example: If you roll 1, 2, and 10, your result is 2. In anydice this is easy to calculate:

output [middle 1 of 3d10]

But then, sometimes I would need to re-roll the highest or lowest of the dices (representing small advantages or disadvantages) before taking the middle one. This I have no clue how to program in anydice.

The best I came up with is something like this:

output [highest of [middle 1 of 3d10] and 1d10] named "Advantage"

output [lowest of [middle 1 of 3d10] and 1d10] named "Disadvantage"

Is this correct? It doesn't feel right. Should I use some kind of function? (which I don't know how to use, by the way).

I have no idea what I'm doing here, and I have no real skills coding or in maths. Any help would be really appreciated. I feel like this should be really simple, but I'm going insane with this.

The order of operations is:

  1. Roll 3d10
  2. Reroll lowest
  3. Keep the middle one

Best Answer

The default examples on anydice include the following:

output 2@4d20 named "Curved Advantage (4d20 advantage after drop[ing high & low)"
output 2@3d20 named "Curved (3d20 take mid)"

I believe this covers your regular and advantage cases, so all that's left is to add your disadvantage case, which we can do by rolling four dice and taking the third-highest value:

output 3@4d20 named "Curved Disadvantage (4d20 disadvantage after dropping high & low)"

Here's an example in action.