我在这里创建了3个方法,我还需要一个输出最终成功消息而不是圆形成功消息。
// Used ES7 async/await
const member = await Member.create({ ... });
const addition1 = await MemberAddition.create({ ... });
const addition2 = await MemberAddition.create({ ... });
await addition1.setMember(member);
await addition2.setMember(member); // Should be failed or set addition1 MemberId null
答案 0 :(得分:2)
def display_results(player, computer, counts)
prompt(
case
when counts[:player] == 3 then "You won the game! Congrats!"
when counts[:computer] == 3 then "Computer won the game. Try again?"
when win?(player, computer) then "You won this round!"
when win?(computer, player) then "Computer won this round! You loose!"
else "It's a tie on this round! No one wins!"
end
)
end
应该在轮次结果之前检查游戏结果。