I can't do it in AnyDice, but it's not that hard to code in Python...
# ©2015 William F. Hostman. CC by attribution
# res is output results array - a place to store our output.
res = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
# num is our running total of iterations
num = 0
# work is the array we do the math work upon.
work = [0,0,0,0]
# we now tell it what the die looks like...
diedef = [1,2,3,4,5,6]
# dice: for die in [array of faces]
for a in diedef:
for b in diedef:
for c in diedef:
for d in diedef:
work = a
work = b
work = c
work = d
# insert additional dice above
score = 0
for z in diedef:
tempscore = 0
for y in work:
if y == z:
tempscore += y
if tempscore > score:
score = tempscore
num += 1
# end of work
temp = 0
for score in res:
temp += 1
print temp, score, (1000*score/num)
res needs to have at least as many 0 values as 1+(sides * number).
Each die gets a separate value, but you could shortcut this by defining a die as a variable and replacing the arrays for individual die for statements with that defined array.
work block needs to be indented together. Python is whitespace dependent.
To add a die: add another
for line with another letter, add another 0 to the array
work, add another
work[ ] = line with the next sequential number, and the new die's variable.
You cannot shortcut and simply load
work directly in the
for statements, because the sort routine would screw up the accounting.
The output is in result value, number of occurrences, and permille result (percentage * 10). If you want more places, increase the multiplier in the
Tweaking the dice values
If you want to play around with some funky results, for example, replacing rolls of 1 with 0 (so 1's count as nothing), just replace the 1's in the arrays in the for lines. So the arrays would be [0,2,3,4,5,6].
You switch to d8's by using [1,2,3,4,5,6,7,8].
It's a bit uglier to code for ORE's 2-d results (width and height), but since you weren't asking about that... aw, heck, I'll discuss that, too.
And that's because any true ORE roll has the question of whether one's prioritizing height (value of number counted) or width (number of replications in the roll).
If one prioritizes one or the other, it's easy to grid out. Otherwise, one has to tick the various array locations possible on a 2d grid. The sum of the entries would thus be more than the count of iterations.
This isn't particularly fast code. (Python's not particularly fast, and this isn't optimized code.) But its good enough provided you keep it under 8 dice or so, and those dice are all under d12's.
Above code ©2015 William F. Hostman. Permission to duplicate and use for any legal purpose granted, including inclusion in texts, provided attribution is given.
Code took 10 minutes to write. Took as long or longer to comment it.