battle_boats 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/battle_boats/cell.rb +3 -1
- data/lib/battle_boats/colorize.rb +17 -0
- data/lib/battle_boats/null_ship.rb +4 -1
- data/lib/battle_boats/ship.rb +4 -1
- data/lib/battle_boats/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 765cef2a3566e7f824cd2319ec960c90f0d26622
|
4
|
+
data.tar.gz: 1de5b33a33bce1bac1162ad670ca0af38499d277
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a5e7d65fc210a47de5df56a539fa4d53f0fed11d3f7f67b2aa0f2fca733e7b0f061166dbe1f7e42b002529e8f10ddcb1ccdcb075ac4f17ba1aa1d40593a6ca7
|
7
|
+
data.tar.gz: 68ebe43ee2985c47cd9275d71e138ebc085b7074ca76e43bf62edaa4cf8ee96e9885d3e53b14c90b06241abc075bc5f3f9630b732fa8e5b711b655355d7ffe19
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/battle_boats/cell.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require_relative "null_ship"
|
2
|
+
require_relative "colorize"
|
2
3
|
|
3
4
|
module BattleBoats
|
5
|
+
using Colorize
|
4
6
|
class Cell
|
5
7
|
attr_accessor :occupant
|
6
8
|
|
@@ -23,7 +25,7 @@ module BattleBoats
|
|
23
25
|
if hit?
|
24
26
|
occupant.symbol
|
25
27
|
else
|
26
|
-
"."
|
28
|
+
".".blue
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
data/lib/battle_boats/ship.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
require_relative "colorize"
|
2
|
+
|
1
3
|
module BattleBoats
|
4
|
+
using Colorize
|
2
5
|
class Ship
|
3
6
|
attr_reader :name, :length, :symbol
|
4
7
|
|
5
8
|
def initialize(name:, length:, symbol: "O")
|
6
9
|
@name = name
|
7
10
|
@length = length
|
8
|
-
@symbol = symbol
|
11
|
+
@symbol = symbol.red
|
9
12
|
end
|
10
13
|
|
11
14
|
def empty?
|
data/lib/battle_boats/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: battle_boats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Countz
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/battle_boats.rb
|
109
109
|
- lib/battle_boats/board.rb
|
110
110
|
- lib/battle_boats/cell.rb
|
111
|
+
- lib/battle_boats/colorize.rb
|
111
112
|
- lib/battle_boats/console_ui.rb
|
112
113
|
- lib/battle_boats/coordinate.rb
|
113
114
|
- lib/battle_boats/engine.rb
|