liarsdice_cbarcroft 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/liars_dice.rb
CHANGED
@@ -9,7 +9,11 @@ class LiarsDice
|
|
9
9
|
@players = {:player => "Player", :computer => "Computer"}
|
10
10
|
@current_player = first_turn
|
11
11
|
if first_turn == false
|
12
|
-
|
12
|
+
if [:computer, :player].respond_to?(sample) then
|
13
|
+
@current_player = [:computer, :player].sample
|
14
|
+
else
|
15
|
+
@current_player = [:computer, :player].choice
|
16
|
+
end
|
13
17
|
end
|
14
18
|
@waiting_player = [:computer, :player].select{|player| player != @current_player}[0]
|
15
19
|
@current_bet = {:face => 1, :count => 1}
|