This program should do what you want:
function: push REROLL:s HITS:n SIXES:n {
NEW_HITS: [count {5, 6} in REROLL]
NEW_SIXES: [count 6 in REROLL]
if SIXES + NEW_SIXES >= 2 {
result: 3
}
if NEW_HITS >= 1 {
result: [lowest of HITS + NEW_HITS and 2]
}
result: [lowest of HITS - 1 and 2]
}
function: vaesen INITIAL:s {
HITS: [count {5, 6} in INITIAL]
SIXES: [count 6 in INITIAL]
BLANKS: [count {2, 3, 4} in INITIAL]
if SIXES >= 2 {
result: 3
}
if HITS >= 1 & BLANKS >= 1 {
result: [push BLANKSd6 HITS SIXES]
}
result: [lowest of HITS and 2]
}
loop C over {1..6} {
output [vaesen Cd6] named "[C]d"
}
Note that there are some subtleties:
- There is no reason to reroll if you rolled two sixes initially.
- You can't reroll if there are no blanks.
You might also explore strategic pushing.
For what it's worth, I have a more advanced calculator for the SRD version of the Year Zero Engine, though Vaesen does not use this version.