0
私は可能であれば1に次の2つの句(互いの正反対)をリファクタリングしたい
をリファクタリングしますPythonはどのように反対の数句
if who == 0:
score = take_turn(strategy0(score0, score1), score1, select_dice(score0, score1))
if score == 0:
score1 += strategy0(score0, score1)
else:
score0 += score
elif who == 1:
score = take_turn(strategy1(score1, score0), score0, select_dice(score1, score0))
if score == 0:
score0 += strategy1(score1, score0)
else:
score1 += score
どのように私は、次の可能性を作るのでしょうか?
def other(who)
return 1 - who
score = take_turn(strategy+who(score+who, score+other), score+other, select_dice(score+who, score+other))
if score == 0:
score+other += strategy+who(score+who, score+other)
else:
score+who += score