Skip to content

Instantly share code, notes, and snippets.

@clay-whitley
Created July 29, 2013 17:55
Show Gist options
  • Select an option

  • Save clay-whitley/6106215 to your computer and use it in GitHub Desktop.

Select an option

Save clay-whitley/6106215 to your computer and use it in GitHub Desktop.
wax on/wax off
require 'csv'
module FlashCardDB
def self.parse
result = []
CSV.foreach("flashcards.csv") do |row|
unless row[0] == "definition"
result << {definition: row[0], term: row[1]}
end
end
result
end
end
class GameController
def self.start_game
card_args = FlashCardDB.parse
deck = Deck.new
card_args.each do |arg|
deck.add_card(arg)
end
game = Game.new(deck)
game.play_game
end
end
GameController.start_game
definition term
bar foo
buzz baz
things stuff
some stuff random term
has a nice haircut clay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment