bin/99_game in 99_game-1.0.3.pre vs bin/99_game in 99_game-1.0.3
- old
+ new
@@ -37,14 +37,10 @@
END { # Thanks for playing
sleep(2)
puts "\n\tThanks for playing 99!"
sleep(3)
}
-def pause(p)
- sleep(p)
- puts
-end
$value, value1, value2, value3, dealer, user = 0,0,0,0, Hand.new, Hand.new
loop do
$deck.shuffle!
puts
puts "\tIt is the dealer's turn!"
@@ -87,10 +83,16 @@
puts "\tIt's your turn!"
pause(1.5)
user.view
pause(0.5)
print "\tPick a card to play by typing in the name of the card => "
- user.play(UserCard.new(gets.chomp))
+ input, turn = gets.chomp, true
+ for card in user.hand
+ if card.num == converter(input) && turn
+ user.play(card)
+ turn = false
+ end
+ end
pause(1.5)
puts "\tYou drew a(n) #{user.hand[2].num}"
pause(0.5)
puts "\tThe value is now #{$value}"
pause(2)