Sha256: 574d6267cc08d3a276db2007c6c8d80ea313811359f81789a9826485e1bb3a38

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

#! /usr/bin/env ruby
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require "querinator"

@path = "./spec/test_question_file.txt"
def runit
  questions = Querinator::Importer.new.parse(@path)
  random_question = questions.sample
  puts random_question.pose

  input = gets()
  input = input.chomp

  if  random_question.is_correct?(input)
    puts "Hooray!!"
  else
    puts "oooooh."
    puts "The correct answer was '#{random_question.answer}'"
  end
end

runit

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
querinator-0.0.2 bin/querinator
querinator-0.0.1 bin/querinator