dice sovle brute force and optimal action solve