# HG changeset patch
# User ARAKI Tsuyohito さかたっち
diff -r c110d66cb0d9 -r 3147f6e92f0a oasis2015/prof.rb
--- a/oasis2015/prof.rb Fri Jul 17 14:58:40 2015 +0900
+++ b/oasis2015/prof.rb Fri Jul 17 15:43:40 2015 +0900
@@ -131,7 +131,7 @@
end
qrAC = qrc ###生成したハッシュには、"乱数"=>"記号"が入っている
-getAC = ARGV[0].to_i ###URL?以降の文字(特定の乱数)を取得
+getAC = ARGV[0].to_i ###URL?以降の文字(特定の乱数)を取得してgetACに代入
qr = qrAC[getAC] ###特定の"乱数"が一致すると、"乱数"=>"記号"がqrに正しく入力される。
if qr =="a" && q1 == 0
q1 += 1
@@ -303,12 +303,85 @@
+
+########################
+###lv==5のとき画像を変える###
+comm = ""
+if ARGV[0] == "commandbomd"
+comm += ''
+elsif lv == 5
+comm += ''
+end
+
+if bom == "inu1"
+image = "./img/inu1.png"
+elsif bom == "inu2"
+image = "./img/inu2.png"
+elsif bom == "inu3"
+image = "./img/inu3.png"
+elsif bom == "inu4"
+image = "./img/inu4.png"
+elsif bom == "inu5"
+image = "./img/inu5.png"
+
+elsif bom == "sisip1"
+image = "./img/sisip1.png"
+elsif bom == "sisip2"
+image = "./img/sisip2.png"
+elsif bom == "sisip3"
+image = "./img/sisip3.png"
+elsif bom == "sisip4"
+image = "./img/sisip4.png"
+elsif bom == "sisip5"
+image = "./img/sisip5.png"
+
+elsif bom == "kamon1"
+image = "./img/kamon1.png"
+elsif bom == "kamon2"
+image = "./img/kamon2.png"
+elsif bom == "kamon3"
+image = "./img/kamon3.png"
+elsif bom == "kamon4"
+image = "./img/kamon4.png"
+elsif bom == "kamon5"
+image = "./img/kamon5.png"
+
+elsif bom == "boy1"
+image = "./img/boy1.png"
+elsif bom == "boy2"
+image = "./img/boy2.png"
+elsif bom == "boy3"
+image = "./img/boy3.png"
+elsif bom == "boy4"
+image = "./img/boy4.png"
+elsif bom == "boy5"
+image = "./img/boy5.png"
+
+elsif bom == "girl1"
+image = "./img/girl1.png"
+elsif bom == "girl2"
+image = "./img/girl2.png"
+elsif bom == "girl3"
+image = "./img/girl3.png"
+elsif bom == "girl4"
+image = "./img/girl4.png"
+elsif bom == "girl5"
+image = "./img/girl5.png"
+end
+#########################
+#########################
###################################--HTML--##################
###################################--------##################
#以下のprintfについて
#pre*4はstyleの部分、{margin(本来OS_,per,gage,per,per,per,name...)
-printf(<<_EOS_, per, gage, per, per, per, color, kkget, image, alt, name, person, cal, lv, pt, m1, mimg1, m2, mimg2, esa)
+printf(<<_EOS_, per, gage, per, per, per, color, kkget, image, alt, name, person, cal, lv, comm, pt, m1, mimg1, m2, mimg2, esa)
exp
さかたポイント:%dp
diff -r c110d66cb0d9 -r 3147f6e92f0a oasis2015/retry.rb
--- a/oasis2015/retry.rb Fri Jul 17 14:58:40 2015 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-#!/usr/bin/env ruby22
-# -*- coding: utf-8 -*-
-
-require 'sqlite3'
-require 'kconv'
-require 'cgi'
-
-c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
-db = SQLite3::Database.new("sql/main.sq3")
-
-
-sql = "insert into test values(?, ?, ?, ?, ?, ?, ?, ?, ?)"
-
-toi = "insert into toi values (?, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"
-item = "insert into goods values (?, 0, 0, 0, 0, 0, 0)"
-
-name = c["name"]
-
-cle1 = "CREATE TABLE IF NOT EXISTS test(id, name, cal, age, sex, aria, exp, pt, lv)"
-cle2 = "CREATE TABLE IF NOT EXISTS toi(id, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10)"
-cle3 = "CREATE TABLE IF NOT EXISTS goods(id, g1, g2, g3, g4, g5, g6)"
-cle4 = "CREATE TABLE IF NOT EXISTS time(cd, now, id)"
-cle5 = "CREATE TABLE IF NOT EXISTS num(cd, id)"
-
-ins4 = 'insert into time values(?, 61, "n")'
-ins5 = 'insert into num values("aa",0)'
-num = "select id from num where cd = ?"
-numup = "update num set id = ? where cd = ?"
-
-db.execute(cle1)
-db.execute(cle2)
-db.execute(cle3)
-db.execute(cle4)
-db.execute(cle5)
-
-name = c["name"]
-namae = "#{name}"
-cal = c["cal"]
-age = c["age"]
-sex = c["sex"]
-aria = c["aria"]
-
-id = c.cookies["id"][0]
-if id == nil
-# srand
-# id = rand(1000)
- number = db.execute(num, "aa")
- id = number[0][0].to_i + 1
- exp = 0
- pt = 0
- lv = 1
- cd = "aa"
- db.execute(sql, id, name, cal, age, sex, aria, exp, pt, lv)
-
- db.execute(toi, id)
- db.execute(item, id)
- db.execute(numup, id, cd)
-end
- srand(id.to_i)
- id2 = rand(1000000)
-
-
-
-
-expires = 10
-
-printf("Content-type: text/html; charset=UTF-8
-Set-Cookie:id=%s ;expires=%s
-Set-Cookie:pass=%s ;expires=%s\n\n", id, expires, id2, expires)
-
-printf(<<_EOS_, name, id.to_i)
-
-
-
-
-
-
-
-
-
-
-
-
-
-さかたっち-登録が完了しました!-ようこそ_ %s _さん! -あなたのIDは%04dです。抽選はこのIDを元に行われます。 - - - -_EOS_ - - -if name == "createman987987987" - `rm sql/main.sq3` -# `touch sql/main.sq3` -# `chmod a+w sql/main.sq3` -end |