var minimum = 6 var total = 0 for i in range(4): var roll = randi_range(1,6) minimum = min(minimu, roll) total += roll total -= minimum