#!/usr/bin/env ruby
require 'csv'

course = CSV.read("course1.csv")
stage1 = {
  "0" => "  ",
  "1" => "@@",
  "3" => "\e[33m●"
}
stage2 = {
  "0" => "・",
  "1" => "\e[33m##\e[m",
  "3" => "\e[33m●"
}

def makescreen(map, code)
  print("\e[2J\e[1;1H")
  map.each do |row|
    row.each do |column|
      print("\e[34m")
      print code[column]
    end
    puts
  end
  print("\e[m")
end

makescreen(course, stage1)
# makescreen(course, stage2)
