blackjack1 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/blackjack1 +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTE0OTNjYWIzOTA0NDQzNWI2MjU4MDA1ZmQwZDMwZTMwNWI1ZjMzMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzMxOWViMDMzNzdkODJiZmQ5MGFhYTY4NTFjYmRiMGM5YmFiODcyMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWJiZDRlMWQ3MWFmODMwZjhhYjAyNTgxYzc5NmI3ODg0YWY1MDc5NGY1NTU4
|
10
|
+
ZTM1OTFjNzEzZmE3M2IxYzkxOGE4ZGYwNmM5NGQ4OTg3YzY0Y2NhMGIzYTM1
|
11
|
+
MWM0MGRiNDlmZWE4NTM4YThkMDlhMzcxZTFkZjQxMTdjMzg2MWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmMzNGI4MmNmYjI4YjM5YzJiNjgxYjU5OTdjYjVkMmNlNWQzYzJkMmU4NjEy
|
14
|
+
NTY3OTc1N2I3NjkyZDJjY2NjNjA5ZjAxODY4ODc2Mzg3MzIyMjczZWNkNzYz
|
15
|
+
NzNkMjM5N2I5MWJjZDQzNjFjMTE3NjE0ZjY4YjdlMGIxZDY1OTM=
|
data/bin/blackjack1
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "blackjack1"
|
3
|
-
Hand.deck,
|
3
|
+
Hand.deck, inputerror = CardDeck::Deck.new, "Invalid input. Please input '(h)it' or '(s)tay'"
|
4
4
|
dealer, player, view = Hand.new, Hand.new, proc do |player|
|
5
5
|
puts "You have: #{player.view}"
|
6
6
|
sleep(0.5)
|
@@ -13,11 +13,11 @@ unless player.blackjack?
|
|
13
13
|
sleep 1
|
14
14
|
loop do
|
15
15
|
puts
|
16
|
-
catch
|
16
|
+
catch inputerror do
|
17
17
|
print "(h)it or (s)tay? "
|
18
18
|
action = gets.chomp.downcase
|
19
19
|
if action.include?("s") then break
|
20
|
-
elsif !action.include?("h") then throw
|
20
|
+
elsif !action.include?("h") then throw inputerror
|
21
21
|
end
|
22
22
|
end
|
23
23
|
sleep(1)
|