2014-07-19 56 views

回答

-2

[:computer, :player].shuffle.first會給你隨機誰是第一。

+2

'sample' is more enough – bjhaid

+0

我正在關注的教程使用這個 – user3684357

+0

cpu = rand()> 0.5? 'X':'O' user = @cpu =='X'? 'O':'X' – user3684357