A simple issue, but can't figure out how to solve it, lacking knowledge in Ruby language:
class Game
def initialize
get_command
end
def get_command
command = gets
puts command # => POSITION
puts command != "POSITION" # => true
if command != "POSITION"
command = get_command
else
return true
end
end
end
a = Game.new
Whenever I run an application and type POSITION it always gets the true comparing to "POSITION" can anyone explain why?
Thanks