Newer
Older
escapegame-2022 / yuto / entrance / judge.rb
@Yuto Togashi Yuto Togashi on 24 May 2022 827 bytes fix ruby
#!/usr/bin/env ruby
# coding: utf-8

require 'cgi'
c = CGI.new(:accept_charset => "UTF-8")
print "Content-type: text/html; charset=UTF-8\n\n"

ans1 = c["ans1"]
ans2 = c["ans2"]
ans3 = c["ans3"]
ans4 = c["ans4"]
ans5 = c["ans5"]
ans6 = c["ans6"]

print "<!DOCTYPE html>
<html lang=\"ja\">
<head>
  <title>結果|庄内AR謎解きゲーム(仮)</title>
  <link rel=\"stylesheet\" type=\"text/css\" href=\"escape.css\">
</head>

<body>
<h1>庄内AR謎解きゲーム(仮)</h1>\n\n"

if ans1 == "さかた" || ans2 == "しょうない" || ans3 == "つるおか" || ans4 == "ゆざ" || ans5 == "みかわ" || ans6 == "いもに" 
  print "<p class=\"ok\">正解!!</p>\n"
else
  print "<p class=\"ng\">不正解…</p>\n"
end

print "<hr>
<p><a href=\"entrance.html\">トップページへ戻る</a></p>"

print "
</body>
</html>"