+ g.dice()
+ reward = g.get_score() - old_score
+ new_state_qid = find_state_qid(g.get_shutable(), g.get_diced())
+ lr = 0.1
+ gamma = 0.99
+ Q[state_qid, opt_qid] = Q[state_qid, opt_qid] + \
+ lr * (reward + gamma * np.max(Q[new_state_qid, :]) - Q[state_qid, opt_qid])
+ state_qid = new_state_qid
+ running_score[0] *= 0.999
+ running_score[0] += g.get_score()
+ running_score[1] *= 0.999
+ running_score[1] += 1.0
+ print( "%d: %f" % (i, running_score[0]/running_score[1]) )