view minato2014/hoge.rb @ 1327:a242c5bd99f7

merged
author GOTO Sakuya<c113061@e.koeki-u.ac.jp>
date Tue, 15 Dec 2015 19:02:50 +0900
parents f24e989eca53
children
line wrap: on
line source

#!/usr/bin/env ruby
#coding:utf-8

require 'cgi'
require 'cgi/session'
require 'nkf'

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

name = NKF.nkf('-w',ARGV[0])
png = ARGV[1].to_s+ARGV[2].to_s
png = NKF.nkf('-w',png)
lv = 1

printf(<<_EOS_,"こ","こ","に","ス","タ","ン","プ","と","か")
<html>
<head>
<title>てすと</title>

</head>
<body>
<div class="main">
<h1>スタンプラリー</h1>
<table border="1">
<tr><td>%s</td><td>%s</td><td>%s</td></tr>
<tr><td>%s</td><td>%s</td><td>%s</td></tr>
<tr><td>%s</td><td>%s</td><td>%s</td></tr>
</table>
_EOS_

printf(<<_EOS_,name,png,lv)
<div class="gazo">
<p>%sさん</p>
<img src="%s.png">
</div>
<div class="rpg">
LV:%d
</div>
</div>
</body>
</html>
_EOS_

yatex.org