blackjack1 2.0.4 → 2.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +1 -0
  3. data/bin/blackjack1 +20 -13
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjlmZjMwNDU1MmU1ZjVkMjNiNjE2NThiNDM0OGMwYjlhYjU3OTI0NA==
4
+ ZDYwOTA5MjZmMzc4NzJmNjdlOWM0OTA4OTE2M2VlNWM3MmZlMTI3Ng==
5
5
  data.tar.gz: !binary |-
6
- M2I0NzM2MjQxODBhMTcxYTY1NGZjNjY5ZWQ2OTY0YjRiNzI5MjdhZQ==
6
+ MTM4ODJkNjhkZjdmYzc3ODgwNzJhMWJhODkwODYxZmM2NWE2MjdkOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmRkZmMyM2RjZjcxMTA5ZDlhN2ZlOTY3NzdkZjczMmY2NDVlNDAxZGUzMzg3
10
- NzFmZmE1YjYwODAxZTM2MzYyM2Q3Zjk0ZmQ4MDI0MGI4OTliOTc2OGFmZTNm
11
- MTJlZjdhNTk4ZWYxYjczNTYxOGEwNWUwZWYwZDY0NTcxMmUzOGI=
9
+ ZTc0MmE2YzNhMWI2NTg2MDQ0MzIzNjYzNjkyM2IwOGUyYjU1NzhjZmVlNzBi
10
+ Njg5NmU5ZGM5YjY4MWVlMzEyNDJmMmU5ZGFkNzIwNjg4NTY4MWI4M2M4YzIy
11
+ OWEzZjkxZTcwNDliYWIyODdhNTY1MzM3MjhiM2RmYWYwMTMzMWQ=
12
12
  data.tar.gz: !binary |-
13
- MjAyOWM4NzRiODMwNTVkZjlkMzNlMzc5ZDhkMWMxMjI2YzZlM2RjM2U5NDI5
14
- NjMwNjAyYjg3NThkMGY1MzVlYjcxNjE2OGM3YmEwNTU1YTg2NmEwMDdhYTI2
15
- Y2ZhYjZiYjcyMDc3Nzc0ZGVjMWY4ZmNiYmY2NjJiMjY2NWRiNTM=
13
+ ZWJlMTA1OTk1ZTU4YTY3NDdmYTM2ZTk4NTM2NzY1OGYwYjI1N2U5NWZjODNk
14
+ ZGE5YWJlNGU4YTgwYWFiNGIyMGFiZjE2OGViODU3MWZhYTkyNWY4Y2Q5OTk3
15
+ OTNjNzc1NTAwZGQ1OTkxYTc5ZjgzYmRiNGE4NjEzMzY5MDMxNGM=
data/README.md CHANGED
@@ -5,3 +5,4 @@ The commonly played card game in casinos and for fun. Have fun!
5
5
  [![Build Status](https://travis-ci.org/Zrp200/blackjack1.svg?branch=master)](https://travis-ci.org/Zrp200/blackjack1)
6
6
  [![Code Climate](https://codeclimate.com/github/Zrp200/blackjack1/badges/gpa.svg)](https://codeclimate.com/github/Zrp200/blackjack1)
7
7
  [![Test Coverage](https://codeclimate.com/github/Zrp200/blackjack1/badges/coverage.svg)](https://codeclimate.com/github/Zrp200/blackjack1)
8
+ [![Dependency Status](https://gemnasium.com/Zrp200/blackjack1.svg)](https://gemnasium.com/Zrp200/blackjack1)
data/bin/blackjack1 CHANGED
@@ -19,56 +19,63 @@ HELP
19
19
  require "blackjack1"
20
20
  Hand.deck, inputerror = CardDeck::Deck.new, "Invalid input. Please input '(h)it' or '(s)tay'"
21
21
  dealer, player, view = Hand.new, Hand.new, proc do |player|
22
- puts "You have: #{player.view}"
22
+ puts "\tYou have: #{player.view}"
23
23
  sleep(0.5)
24
- puts "Value: #{player.value}"
24
+ puts "\tValue: #{player.value}"
25
25
  sleep(1)
26
26
  end
27
+ puts
27
28
  unless player.blackjack?
28
- puts "The dealer is showing #{dealer.cards[1].abbr}\n"
29
+ puts "\tThe dealer is showing #{dealer.cards[1].abbr}\n"
29
30
  sleep 1
30
31
  loop do
31
32
  puts
32
33
  view.call player
33
- print "(h)it or (s)tay? "
34
+ if player.length == 2 then print "\t(d)ouble, (h)it, or (s)tay? "
35
+ else; print "\t(h)it or (s)tay? "
36
+ end
34
37
  action = gets.chomp.downcase
35
38
  player.hit if action.include?("h")
36
39
  break if action.include?("s") || player.value >= 21
40
+ if action.include?("d") and player.length == 21
41
+ player.hit
42
+ break
43
+ end
37
44
  end
38
45
  puts ""
39
46
  unless player.bust?
40
- puts "You finished with #{player.value}."
47
+ puts "\tYou finished with #{player.value}."
41
48
  else
42
- puts "You busted @ #{player.value}."
49
+ puts "\tYou busted @ #{player.value}."
43
50
  sleep(1)
44
- puts "Dealer wins"
51
+ puts "\tDealer wins"
45
52
  sleep(2)
46
53
  exit
47
54
  end
48
55
  sleep 2
49
56
  if dealer.blackjack?
50
- puts "Dealer got blackjack."
57
+ puts "\tDealer got blackjack."
51
58
  puts; sleep 0.5
52
- puts "Dealer wins."
59
+ puts "\tDealer wins."
53
60
  sleep 2
54
61
  exit
55
62
  end
56
63
  puts
57
64
  while dealer.value <= Hand::MDHV
58
- puts "The dealer hits!"
65
+ puts "\tThe dealer hits!"
59
66
  dealer.hit
60
67
  sleep 0.5
61
68
  end
62
69
  puts
63
- if dealer.bust? then puts "The dealer busted @ #{dealer.value}!"
70
+ if dealer.bust? then puts "\tThe dealer busted @ #{dealer.value}!"
64
71
  else
65
72
  puts "The dealer stays @ #{dealer.value}"
66
73
  end
67
74
  sleep 2
68
75
  puts compare_score player, dealer
69
76
  else
70
- puts "You got blackjack!"
77
+ puts "\tYou got blackjack!"
71
78
  puts; sleep 1
72
- puts "You win!"
79
+ puts "\tYou win!"
73
80
  sleep 0.5
74
81
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackjack1
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.1.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Perlmutter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-16 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: card_deck
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '1.2'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -82,9 +82,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
82
  version: 1.9.2
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ! '>='
85
+ - - ! '>'
86
86
  - !ruby/object:Gem::Version
87
- version: '0'
87
+ version: 1.3.1
88
88
  requirements:
89
89
  - Command Prompt
90
90
  rubyforge_project: