mars_rovers_dellan 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/mars_rovers +14 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6e638c007d6a42212a28b3b1e7203d60da1faf4afc0680d836557d9ed24e3a4
4
- data.tar.gz: 392645398edfcb76e5c9b2e77f01b1dcb41b6b6c36b7388149e5b09af1e25e9a
3
+ metadata.gz: '0109cf8ea5f312d1793bd59a89a38ef9e51fdd51d034de84b9aa45a3ffdf8256'
4
+ data.tar.gz: 36149f7172b1861ff6289d6e04b7055152e869619a63ec7f5b72908a2985a750
5
5
  SHA512:
6
- metadata.gz: 5e16890fc44acedc8b5ea6c6345a6cc5319f64cf1c91bb66d6284652b73c8560ed23d8993c91f676c3e9afdc180f5ecf0ad97fa87eef363a83aa67356d2c5121
7
- data.tar.gz: d0175d470a73bdd61b0bc45c0f69acff1d3a33abe95692a8f0b96f381b1757b6fbb9735c4200c80bfbaa943a04e1cdc810a9d519b58b9e0651da1a93f8b1ecca
6
+ metadata.gz: 823ded0f53e82841295e1fb9f2ca265956c2d4ac282b3d2ec91473c53e86377527366c4b93c0c226b78cbcaebbd3c5b7754fff15ef1d63feb64fbb6f6a87c724
7
+ data.tar.gz: 218772c514d86b03b04a054db8dc0e1846764068bfaac51c3fc701f3523511669952fd488f04ee0877e166f70d1a99ba5b1f87b13ba816c48918a53e7245c06e
data/bin/mars_rovers CHANGED
@@ -2,10 +2,6 @@
2
2
 
3
3
  require_relative "../lib/mars_rovers/rover_station"
4
4
 
5
- puts ""
6
- puts ""
7
- puts "\e[34m🪐🪐Add Rovers to the Plateau🪐🪐\e[0m"
8
-
9
5
  max_grid_x = ARGV.shift
10
6
  max_grid_y = ARGV.shift
11
7
 
@@ -14,7 +10,20 @@ if !max_grid_x || !max_grid_x
14
10
  max_grid_y = 5
15
11
  end
16
12
 
17
- rover_station = MarsRovers::RoverStation.new(max_grid_x.to_i, max_grid_y.to_i)
13
+ max_grid_x = max_grid_x.to_i
14
+ max_grid_y = max_grid_y.to_i
15
+
16
+ if max_grid_x <= 0 || max_grid_y <= 0
17
+ puts "\e[31mInvalid max grid coordinates)\e[0m"
18
+ exit(1)
19
+ end
20
+
21
+ puts ""
22
+ puts ""
23
+ puts "\e[34m🪐🪐Add Rovers to the Plateau🪐🪐\e[0m"
24
+ puts "grid size (#{max_grid_x}, #{max_grid_y})"
25
+
26
+ rover_station = MarsRovers::RoverStation.new(max_grid_x, max_grid_y)
18
27
 
19
28
  loop do
20
29
  puts ""
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mars_rovers_dellan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dellan Muchengapadare