diff --git a/gotouchi_quiz.rb b/gotouchi_quiz.rb new file mode 100755 index 0000000..5b264bf --- /dev/null +++ b/gotouchi_quiz.rb @@ -0,0 +1,36 @@ +#!/usr/bin/env ruby +require 'cgi' +require 'csv' + +cgi = CGI.new + +# HTMLのContent-Typeを設定 +puts cgi.header("text/html; charset=utf-8") + +# CSVファイルから問題を読み込む +questions = [] +CSV.foreach("gotouchi_data.csv", headers: true) do |row| + questions << { + county: row["県名"], + character: row["キャラクター名"], + feature: row["特徴"] + } +end + +# HTMLを出力 +puts "