Permalink
Browse files

Check if user input was an empty string. Update top level documentation

  • Loading branch information...
SelenaSmall committed Aug 28, 2017
1 parent a2e442a commit 7c3f7506094e12475029d132022735f5efde15ad
Showing with 8 additions and 4 deletions.
  1. +2 −2 README.md
  2. +4 −2 lib/action.rb
  3. +2 −0 toy_robot.rb
@@ -4,12 +4,12 @@ Toy robot simulator written in Ruby
***
## Installation
Environment: Built on Mac OSx using Ruby -v 2.4.1
Environment: Built on Mac OSX 10.11.6 using Ruby -v 2.4.1
Make sure you have the correct version of ruby installed
https://www.ruby-lang.org/en/documentation/installation/
Clone this Repo
Clone this Repo
> $ git clone https://github.com/selenasmall/toy_robot.git
In root of the app run bundle install
@@ -53,9 +53,10 @@ def report(position)
OPTIONS = %w[WEST NORTH EAST SOUTH].freeze
# Prev Option method
# Prev option method
# Find previous value in the options array
# @param direction [String]
# @param options [Array]
# @return previous direction
def prev_option(direction)
return unless OPTIONS.include?(direction)
@@ -68,9 +69,10 @@ def prev_option(direction)
OPTIONS.fetch(i)
end
# Next Option method
# Next option method
# Find next value in the options array
# @param direction [String]
# @param options [Array]
# @return next direction
def next_option(direction)
return unless OPTIONS.include?(direction)
@@ -13,6 +13,8 @@
loop do
input = gets.chomp
next if input.empty?
unless 'EXIT'.match?(input)
command.interpret(input)
next

0 comments on commit 7c3f750

Please sign in to comment.