Permalink
Browse files

Main loop for reading user inputs

  • Loading branch information...
SelenaSmall committed Aug 26, 2017
1 parent f5bb3b5 commit f03ae4b51dc9ced1b9d882b5710ee7065b68b479
Showing with 14 additions and 0 deletions.
  1. +14 −0 toy_robot.rb
@@ -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.