class DuckLingo::LearnLang

Public Class Methods

invent_usage() click to toggle source

Invents a new purpose for things.

# File lib/DuckLingo.rb, line 43
def self.invent_usage
  system("clear")
  
  require "gabbler"
  
  gabbler = Gabbler.new
  
  user_iterate = File.read("data/iterations.txt").strip.to_i
  
  information   = File.read('data/information.txt')
  
  gabbler.learn(information)

  user_iterate.times do
    puts gabbler.sentence
  end
end
spout_gabble() click to toggle source

Teaches the correct usage of a word.

# File lib/DuckLingo.rb, line 30
def self.spout_gabble # spouts data
  system("clear")
  
  user_iterate = File.read("data/iterations.txt").strip.to_i
  
  information   = File.readlines('data/information.txt')

  user_iterate.times do
    puts information.sample
  end
end