battle_boats 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9b10aee1f2048f395a0630511233753ec454a6e
4
- data.tar.gz: 3b7ef2c6e80f95c78a4d3967287d4874473e6f15
3
+ metadata.gz: dadd59a7577daa0ee72910ae66b905d4064eb074
4
+ data.tar.gz: 190263c08aec175df8720e7711d4bf9f842ee9c0
5
5
  SHA512:
6
- metadata.gz: 4815fb5a29d9d59188c18326035e249abfacf7174b29d0ab4fd1c06424a4cf10df75c96b7c7c5497c4ab11881565c57f9d8140e32b6fdd5a561c266abd439eb3
7
- data.tar.gz: 5c3d7dd1d4b9a987187b9a410d051621fe845b57f45ce6a798ebc675c6617e88b4e7da8420835d41a07a63aa6de44c922c1f906dd3e8643833828a297a4d680b
6
+ metadata.gz: 45d24201004142d06df0644891af60f4e38706fdd45b4d991265a9bdc05632beb1302549e7e023c5e4bea87e844dbb8bd937cff0cd96d3c65e6d9a97bbe6d6d4
7
+ data.tar.gz: 7b04df2c019d2b82162faa68d4d51270226ebb9e823aad9bbaf94e98574cb7d8ffe2e8313dd4c0068c99978deb882dc6de055f126a2e9ec50ed3e7a6f839a646
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.9
2
+ ### New Features
3
+ - Displays "won" message once all the ship are sunk
4
+
1
5
  # 0.0.8
2
6
  ### New Features
3
7
  - Displays "sunk" message one a ship has been hit along its entire length
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- battle_boats (0.0.8)
4
+ battle_boats (0.0.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,4 +1,5 @@
1
1
  require "battle_boats/cell"
2
+ require "battle_boats/fleet"
2
3
 
3
4
  module BattleBoats
4
5
  class Board
@@ -30,7 +31,11 @@ module BattleBoats
30
31
  end
31
32
 
32
33
  def game_over?
33
- false
34
+ if BattleBoats::FLEET.all?(&:sunk?)
35
+ true
36
+ else
37
+ false
38
+ end
34
39
  end
35
40
 
36
41
  def cell_at(coordinate:)
@@ -33,6 +33,10 @@ module BattleBoats
33
33
  output.puts errors
34
34
  end
35
35
 
36
+ def win
37
+ output.puts "You've won the game!"
38
+ end
39
+
36
40
  private
37
41
 
38
42
  attr_reader :output, :input
@@ -20,6 +20,8 @@ module BattleBoats
20
20
  end
21
21
  interface.display_status_report(board.status_report)
22
22
  end
23
+ interface.win
24
+ interface.display_board(board)
23
25
  end
24
26
 
25
27
  private
@@ -1,3 +1,3 @@
1
1
  module BattleBoats
2
- VERSION = "0.0.8".freeze
2
+ VERSION = "0.0.9".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: battle_boats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Countz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2018-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler