Created
September 28, 2020 22:17
-
-
Save valarauca/c1d26a994984add000641a514924d01d to your computer and use it in GitHub Desktop.
NewRezProtocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Complete(PoolSize, RemainingModels, WoundsPerModel)= if RemainingModels=0 then 1 else if PoolSize=0 then 1 else if PoolSize<WoundsPerModel then 1 else 0 | |
function RPRoll(PoolSize, RemainingModels, WoundsPerModel,Success)= if 1 <= sum WoundsPerModel <= ( count Success <= PoolSize d6 ) then 1 else 0 | |
function PRRollRecursive(PoolSize, RemainingModels, WoundsPerModel, Success)= | |
if (call Complete(PoolSize, RemainingModels, WoundsPerModel))=1 then | |
0 | |
else | |
if (call RPRoll(PoolSize, RemainingModels, WoundsPerModel,Success)) = 1 then | |
1 + call PRRollRecursive(PoolSize-WoundsPerModel, RemainingModels-1, WoundsPerModel, Success) | |
else | |
call PRRollRecursive(PoolSize, RemainingModels-1, WoundsPerModel, Success) | |
function RPTop(RemainingModels, WoundsPerModel, Success) = call PRRollRecursive(RemainingModels*WoundsPerModel, RemainingModels, WoundsPerModel, Success) | |
call RPTop(${LOST_MODELS},${WOUNDS_PER_MODEL},${SUCCESS_ON}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment