2016-12-11 14:37:53 +01:00
|
|
|
#require_relative 'crane_class'
|
|
|
|
require 'json'
|
2016-12-08 08:49:58 +01:00
|
|
|
|
2016-12-11 14:37:53 +01:00
|
|
|
def introduce
|
|
|
|
puts "Hello, sir. I'm Roman the Crane."
|
|
|
|
end
|
|
|
|
|
|
|
|
file = File.read('test.json')
|
|
|
|
words = JSON.parse(file)
|
|
|
|
|
|
|
|
file2 = File.read('past_forms.json')
|
|
|
|
past_formes = JSON.parse(file2)
|
|
|
|
puts (if words.values.any? { |e| words.key(e).eql? "movement" } && words.length > 1 then "I #{past_formes[words["movement"]] + ' ' + words["directions"]}" else "Ooops" end)
|
|
|
|
puts words["directions"]
|