Skip to content

Commit

Permalink
Main loop for reading user inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
SelenaSmall committed Aug 26, 2017
1 parent f5bb3b5 commit f03ae4b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions toy_robot.rb
Expand Up @@ -7,3 +7,17 @@

# Is this a valid position on the table
puts @table.valid_position?(1, 0)

# Keep reading user inputs while the program is running
loop do
puts 'Select your command'
input = gets.chomp

unless input == 'EXIT'
puts 'Robot has been placed' if input == 'PLACE'
next
end

puts 'Goodbye!'
break
end

0 comments on commit f03ae4b

Please sign in to comment.