PowerShell v2+ v3+, 147 144 137137 133 bytes
$n=$args[0]|sort;while($n){if(($x=$n[0])-eq$n[2]){$s+=100*$x+900*($x-eq1);$a,$b,$c,$n=$n}else{$s+=50*($x-in1,5)+50*($x-eq1);$a}$a,$n=$n}};$s
Crossed out 144 looks kinda like 144?
Takes input $args[0]
and sort
s it, stores it into $n
. Then, while
there are still elements left, we evaluate an if
/else
.
If the first element (temp stored into $x
to save some bytes) matches the third element, we have a triple. Add onto the $s
um the result of some multiplication 100*$x
plus a Boolean-based 900
only if $x
is -eq
ual to 1
. This gets us the requisite 1000
for three ones. Then, peel off the first threetwo elements into $a
, and $b
, $c
and the remaining into $n
-- removing the third element of the triple is handled later.
Otherwise, we don't have a triple, so add on to $s
um the result of another Boolean-based addition. We add 50
if $x
is either 1
or 5
, then add on another 50
if it's -eq
ual to 1
. This section now requires v3+ for the -in
operator. Then
In either case, we still have an element yet to remove, so peel off the first element into $a
and leave the remaining in $n
.
Finally, once the loop is done, place $s
on the pipeline. Output is an implicit Write-Output
at the end of execution.
Test cases
PS C:\Tools\Scripts\golfing> (1,2,3,4,5,6),(1,1,1,2,3,5),(1,1,1,1,1,1),(2,2,2,2,2,2),(6,6,1,5,5,6),(2,3,4,6,2,4),(1,5,1,5,1,5),(5,5,5,5,2,3),(1,1,1,1,1,5),(3,3,4,4,3,4)|%{($_-join',')+" -> "+(.\evaluate-dice-1000.ps1 $_)}
1,2,3,4,5,6 -> 150
1,1,1,2,3,5 -> 1050
1,1,1,1,1,1 -> 2000
2,2,2,2,2,2 -> 400
6,6,1,5,5,6 -> 800
2,3,4,6,2,4 -> 0
1,5,1,5,1,5 -> 1500
5,5,5,5,2,3 -> 550
1,1,1,1,1,5 -> 1250
3,3,4,4,3,4 -> 700