Skip to main content
deleted 3 characters in body
Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

AnyDice, 8582 bytes

function:lN:nK:nL:nl N K L{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!Try it online!

For the output, check the "export" view and "summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N:n K:n L:n {                  \ function with 3 parameters                                     \
  if L<0 {                           \  if L is negative                                              \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die  \
  } else {                           \  else                                                          \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if                                                        \
}                                    \ end function                                                   \

AnyDice, 85 bytes

function:lN:nK:nL:n{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!

For the output, check the "export" view and "summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N:n K:n L:n {            \ function with 3 parameters                                     \
  if L<0 {                           \  if L is negative                                              \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die  \
  } else {                           \  else                                                          \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if                                                        \
}                                    \ end function                                                   \

AnyDice, 82 bytes

function:l N K L{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!

For the output, check the "export" view and "summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N K L {                  \ function with 3 parameters                                     \
  if L<0 {                           \  if L is negative                                              \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die  \
  } else {                           \  else                                                          \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if                                                        \
}                                    \ end function                                                   \
added 244 characters in body
Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

AnyDice, 85 bytes

function:lN:nK:nL:n{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!

For the output, check the "export" view and "summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N:n K:n L:n {            \ function with 3 parameters                                     \
  if L<0 {                           \  if L is negative                                              \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die  \
  } else {                           \  else                                                          \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if                                                        \
}                                    \ end function                                                   \

AnyDice, 85 bytes

function:lN:nK:nL:n{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!

For the output, check the "export" view and "summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N:n K:n L:n {            \ function with 3 parameters \
  if L<0 {                           \  if L is negative \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die \
  } else {                           \  else \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if \
}                                    \ end function \

AnyDice, 85 bytes

function:lN:nK:nL:n{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!

For the output, check the "export" view and "summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N:n K:n L:n {            \ function with 3 parameters                                     \
  if L<0 {                           \  if L is negative                                              \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die  \
  } else {                           \  else                                                          \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if                                                        \
}                                    \ end function                                                   \
added 8 characters in body
Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

AnyDice, 85 bytes

function:lN:nK:nL:n{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!Try it online!

For the output, check the "export" view and "normal""summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N:n K:n L:n {            \ function with 3 parameters \
  if L<0 {                           \  if L is negative \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die \
  } else {                           \  else \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if \
}                                    \ end function \

AnyDice, 85 bytes

function:lN:nK:nL:n{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!

For the output, check the "export" view and "normal" data and take the first value next to the output name.

Ungolfed for readability

function: l N:n K:n L:n {            \ function with 3 parameters \
  if L<0 {                           \  if L is negative \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die \
  } else {                           \  else \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if \
}                                    \ end function \

AnyDice, 85 bytes

function:lN:nK:nL:n{ifL<0{result:[lowestNof(N-L)dK]}else{result:[highestNof(N+L)dK]}}

Try it online!

For the output, check the "export" view and "summary" data and take the first value next to the output name (normally the link brings you there, but if you encounter issues, you know).

Ungolfed for readability

function: l N:n K:n L:n {            \ function with 3 parameters \
  if L<0 {                           \  if L is negative \
    result: [lowest N of (N-L)dK]    \   return the lowest N dice among (N-L) rolls of a K-sided die \
  } else {                           \  else \
    result: [highest N of (N+L)dK]   \   return the highest N dice among (N-L) rolls of a K-sided die \
  }                                  \  end if \
}                                    \ end function \
added 552 characters in body
Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56
Loading
Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56
Loading