blackjack1 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/blackjack1 +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmE4YjFmNGUyMGE4OTZhNzBhZjA2OWQyYzZmNjdlNTgzY2JkNmY3Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDVmNWMyYjJjZTJjOTg3Y2E5MzJjMTlmMTE4OWQyZDg1MTgxYzY0Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmE5ZmE0YjE5Y2JlN2EwNWVlM2ZjODgyOGNmMjQwODk3MWVmMDY5ZTNmNzhl
|
10
|
+
MDk4YTE3NDIxZmI2MDUyMDI4ODYzNzhlNTRkZTA1ZWFkMzVlZDhhZTM3N2Jj
|
11
|
+
MWRjYTVmMDFkNTgxOGY0ODBmMWE5MTUwNDUzMDc5ZTc0MTJmNmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWI2MTA4MzY5YzVkYWU4ODVjOWRlZjEwZTA2YTE1ZDM3MzE4NjM1NzJmODgx
|
14
|
+
ZjY0MTUyMTc4YzQzMDllYmQ1MmQzOTZhMDk4NTBjYWUwZGVhMTA3ZWZjZDVj
|
15
|
+
OTM2NDdkOTNmYTQwZGRkZWMzZmU3OWY4ZjZjYWE3MGU4MGEwOTI=
|
data/bin/blackjack1
CHANGED
@@ -5,7 +5,7 @@ dealer, player, view = Hand.new, Hand.new, proc do |player|
|
|
5
5
|
puts "You have: #{player.view}"
|
6
6
|
sleep(0.5)
|
7
7
|
puts "Value: #{player.value}"
|
8
|
-
sleep
|
8
|
+
sleep(1)
|
9
9
|
end
|
10
10
|
view.call player
|
11
11
|
unless player.blackjack?
|
@@ -13,7 +13,7 @@ unless player.blackjack?
|
|
13
13
|
sleep 1
|
14
14
|
loop do
|
15
15
|
puts
|
16
|
-
|
16
|
+
view.call player
|
17
17
|
print "(h)it or (s)tay? "
|
18
18
|
action = gets.chomp.downcase
|
19
19
|
player.hit if action.include?("h")
|
@@ -23,32 +23,32 @@ unless player.blackjack?
|
|
23
23
|
unless player.bust?
|
24
24
|
puts "You finished with #{player.value}."
|
25
25
|
else
|
26
|
-
puts "You busted."
|
26
|
+
puts "You busted @ #{player.value}."
|
27
27
|
end
|
28
28
|
sleep 2
|
29
29
|
if dealer.blackjack?
|
30
30
|
puts "Dealer got blackjack."
|
31
|
-
sleep 0.5
|
31
|
+
puts; sleep 0.5
|
32
32
|
puts "Dealer wins."
|
33
33
|
sleep 2
|
34
34
|
exit
|
35
35
|
end
|
36
36
|
puts
|
37
37
|
while dealer.value <= Hand::MDHV
|
38
|
-
puts "The dealer
|
38
|
+
puts "The dealer hits!"
|
39
39
|
dealer.hit
|
40
40
|
sleep 0.5
|
41
41
|
end
|
42
42
|
puts
|
43
|
-
if dealer.bust? then puts "The dealer busted!"
|
43
|
+
if dealer.bust? then puts "The dealer busted @ #{dealer.value}!"
|
44
44
|
else
|
45
|
-
puts "The dealer stays
|
45
|
+
puts "The dealer stays @ #{dealer.value}"
|
46
46
|
end
|
47
47
|
sleep 2
|
48
48
|
puts compare_score player, dealer
|
49
49
|
else
|
50
50
|
puts "You got blackjack!"
|
51
|
-
sleep 1
|
51
|
+
puts; sleep 1
|
52
52
|
puts "You win!"
|
53
53
|
sleep 0.5
|
54
54
|
end
|