4
\$\begingroup\$

The way my DM wants to try is roll 3d6 and reroll any 1's or 2's once. If you roll a 2 and the reroll ends up being a 1 you have to take the 1.

\$\endgroup\$
  • \$\begingroup\$ If you rolled a 2, and rerolled it as a 1, are you supposed to reroll it again since only one has been rerolled once? Is the reroll tied to the number or the die? \$\endgroup\$ – Fering Aug 18 '20 at 21:07
  • \$\begingroup\$ I assumed (perhaps incorrectly) it was a situation like great weapon fighting "You may reroll once, but must use the new roll" So rerolling 2's is technically a risk, but statistically a good choice. \$\endgroup\$ – Daveman Aug 18 '20 at 21:23
4
\$\begingroup\$

You can do it like this, using the helper function from this answer:

function: ROLL:n replace FILTER:s with REROLL:d {
  if ROLL = FILTER { result: REROLL }
  result: ROLL
}

X: [d6 replace {1,2} with d6]
output 3dX named "3d6, reroll 1 and 2 once" 

Note that I'm first defining a custom die X that represents a single d6 with 1s and 2s rerolled once, and then rolling three of these custom dice. Especially with large pools of dice this is significantly more efficient than rolling the whole pool at once and feeding the results into a custom function as sequences, since in that case AnyDice isn't smart enough to realize that the individual dice in the pool cannot affect each other.

\$\endgroup\$
3
\$\begingroup\$

https://anydice.com/program/1d573

This should do what you are wanting with a single d6, its a modified great weapon fighting script. I have updated the program to follow common practices better.

function: reroll R:n under N:n {
   if R < N { result: d6 } else {result: R}
}
output 3d[reroll 1d6 under 3]
\$\endgroup\$
  • \$\begingroup\$ Oh, and because I'm an idiot and forgot to include it in the first comment: you should also explain how the code works, so a reader can see why this is correct and how to solve this kind of problem (something about teaching a fish) \$\endgroup\$ – Someone_Evil Aug 18 '20 at 22:12
3
\$\begingroup\$

You just need a 36 sided dice

output 3d{1:2,2:2,{3..6}:8}

See https://rpg.stackexchange.com/a/104780/6203

\$\endgroup\$
  • 4
    \$\begingroup\$ You should really explain how this works, because while it's probably correct, it's not an intuitive solution so showing why it's correct and how to do are important parts of a good answer. \$\endgroup\$ – Someone_Evil Aug 18 '20 at 22:14
  • \$\begingroup\$ An 18-sided die suffices... \$\endgroup\$ – rasher Sep 16 '20 at 21:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.