diff --git a/2014OC/2015test/index.html b/2014OC/2015test/index.html new file mode 100644 index 0000000..f97a2be --- /dev/null +++ b/2014OC/2015test/index.html @@ -0,0 +1,42 @@ + + + +2015オアシス酒田祭 + + + + +

2015オアシス酒田祭

+

入力してね

+
+

名前:(ニックネーム)

+

生別:

+

年代:

+

出身地:

+

キャラ:

+

(好きなキャラを選んでください)

+
+代替テキスト +
+ + diff --git a/2014OC/2015test/test.rb b/2014OC/2015test/test.rb new file mode 100755 index 0000000..6e482a6 --- /dev/null +++ b/2014OC/2015test/test.rb @@ -0,0 +1,71 @@ +#!/usr/bin/env ruby +# -*- coding: utf-8 -*- + +require 'cgi' +require 'sqlite3' +require './magic.rb' + +c = CGI.new(:accept_charset => "UTF-8") +db = SQLite3::Database.new("./sql/stamp.sq3") + +begin + result = db.execute("select * from main;") + max = "select max(id) from main;" +rescue + db.execute("create table main(id INTEGER PRIMARY KEY AUTOINCREMENT,name,sex,age,aria,cal,stamp_status,stamp_img,exp INTEGER,rank INTEGER,magic)"); + db.execute("insert into main(name,sex,age,aria,cal,stamp_status,stamp_img,exp,rank,magic) values('名前','性別','年代','住所','職業','スタンプ状況','スタンプ画像','レベル','当選順位','本人確認用')"); + result = db.execute("select * from main;") + max = "select max(id) from main;" +end + +id = c.cookies["id"][0] +c_magic = c.cookies["magic"][0] +name = c["name"] +cal = c["cal"] +age = c["age"] +sex = c["sex"] +aria = c["aria"] + +begin +sel = 'select * from main where id=? AND magic=?' +h = db.execute(sel, id.to_i, c_magic.to_i) +rescue +h == [] +end + +if id != nil && h != [] +update = 'update main set name=?, cal=?, age=?, sex=?, aria=? where id=? and magic=?' +mg = c_magic +db.execute(update, name, cal, age, sex, aria, id.to_i, mg.to_i) +else +code = magic() +id = db.execute(max).flatten(2)[0].to_i + 1 +mg = code[id] +sql = "insert into main(name,sex,age,aria,cal,stamp_status,stamp_img,exp,rank,magic) values (?,?,?,?,?,?,?,?,?,?);" +db.execute(sql,name,sex,age,aria,cal,'000010000','n,n,n,n,kamo1,n,n,n,n',0,0,mg); #初期値 +end + +expires = "SAT, 26 Oct 2015 00:00:00 GMT" + + +printf(<<_EOS_,id, expries, mg.to_s, exprires) +Content-type: text/html; charset=UTF-8 +Set-Cookie:id=%s ;expires=%s +Set-Cookie:magic=%s;expires=%s + + + +#{id} + + + +

+・#{name}
・#{cal}
・#{age}
・#{sex}
・#{aria}
・#{id} +

+ +

+tukaretanaaaa、#{names} +

+ + +_EOS_ diff --git a/oasis2015/accountcheck.rb b/oasis2015/accountcheck.rb index 1b19dba..25fabd2 100755 --- a/oasis2015/accountcheck.rb +++ b/oasis2015/accountcheck.rb @@ -44,12 +44,14 @@ Registering Account - + -

ようこそ%sさん。

-

あなたのIDは%04dです。抽選はこのIDを元に行われます

-

下記リンクからスタンプラリーを開始して下さい!

-

>> Let\'s go oasis-fes! <<

+ +

さかたっち

+

登録が完了しました!

+

ようこそ_ %s _さん!

+

あなたのIDは%04dです。抽選はこのIDを元に行われます。

+
始めよう!
diff --git a/oasis2015/gohan.rb b/oasis2015/gohan.rb index 8e562f0..ff3c6a5 100755 --- a/oasis2015/gohan.rb +++ b/oasis2015/gohan.rb @@ -53,7 +53,7 @@ kekka ="しつもん に こたえられるのは いっかい だけだよ!" end else - kekka = "ぽいんと足りてないでしょ!!!!" + kekka = "ポイント が たりない!" end if exp >= lv*10 && lv < 5 @@ -90,7 +90,7 @@ -

gohanwoageruyooooooo!!!

+

ごはん!

%sさん
exp:%d
diff --git a/oasis2015/img/foot.png b/oasis2015/img/foot.png new file mode 100644 index 0000000..cce9f0a --- /dev/null +++ b/oasis2015/img/foot.png Binary files differ diff --git a/oasis2015/img/head.png b/oasis2015/img/head.png new file mode 100644 index 0000000..fe701ac --- /dev/null +++ b/oasis2015/img/head.png Binary files differ diff --git "a/oasis2015/img/kamon\357\274\221.png" "b/oasis2015/img/kamon\357\274\221.png" new file mode 100644 index 0000000..c3c8f08 --- /dev/null +++ "b/oasis2015/img/kamon\357\274\221.png" Binary files differ diff --git "a/oasis2015/img/kamon\357\274\222.png" "b/oasis2015/img/kamon\357\274\222.png" new file mode 100644 index 0000000..a0ffe22 --- /dev/null +++ "b/oasis2015/img/kamon\357\274\222.png" Binary files differ diff --git a/oasis2015/img/qr/q1.png b/oasis2015/img/qr/q1.png new file mode 100644 index 0000000..ce27055 --- /dev/null +++ b/oasis2015/img/qr/q1.png Binary files differ diff --git a/oasis2015/img/qr/q2.png b/oasis2015/img/qr/q2.png new file mode 100644 index 0000000..41541c8 --- /dev/null +++ b/oasis2015/img/qr/q2.png Binary files differ diff --git a/oasis2015/img/qr/q3.png b/oasis2015/img/qr/q3.png new file mode 100644 index 0000000..d4ca9d4 --- /dev/null +++ b/oasis2015/img/qr/q3.png Binary files differ diff --git a/oasis2015/img/qr/q4.png b/oasis2015/img/qr/q4.png new file mode 100644 index 0000000..c1c4a0a --- /dev/null +++ b/oasis2015/img/qr/q4.png Binary files differ diff --git a/oasis2015/img/qr/q5.png b/oasis2015/img/qr/q5.png new file mode 100644 index 0000000..08917f6 --- /dev/null +++ b/oasis2015/img/qr/q5.png Binary files differ diff --git a/oasis2015/img/qr/touroku.png b/oasis2015/img/qr/touroku.png new file mode 100644 index 0000000..d7ea171 --- /dev/null +++ b/oasis2015/img/qr/touroku.png Binary files differ diff --git a/oasis2015/img/sisip1.png b/oasis2015/img/sisip1.png new file mode 100644 index 0000000..7a3219e --- /dev/null +++ b/oasis2015/img/sisip1.png Binary files differ diff --git a/oasis2015/img/sisip2.png b/oasis2015/img/sisip2.png new file mode 100644 index 0000000..73f779e --- /dev/null +++ b/oasis2015/img/sisip2.png Binary files differ diff --git a/oasis2015/img/sisip3.png b/oasis2015/img/sisip3.png new file mode 100644 index 0000000..1baf640 --- /dev/null +++ b/oasis2015/img/sisip3.png Binary files differ diff --git a/oasis2015/img/sisip4.png b/oasis2015/img/sisip4.png new file mode 100644 index 0000000..ffb7723 --- /dev/null +++ b/oasis2015/img/sisip4.png Binary files differ diff --git a/oasis2015/img/sisip5.png b/oasis2015/img/sisip5.png new file mode 100644 index 0000000..e4f78bc --- /dev/null +++ b/oasis2015/img/sisip5.png Binary files differ diff --git a/oasis2015/index.html b/oasis2015/index.html index 22c5b43..57faa9b 100644 --- a/oasis2015/index.html +++ b/oasis2015/index.html @@ -2,42 +2,43 @@ "http://www.w3.org/TR/html4/strict.dtd"> -2015オアシス酒田祭 - +さかたっち + -

2015オアシス酒田祭

-

入力してね

+

さかたっち

~酒田の自然に囲まれて~

+

キャラクターを登録しよう!

-

名前:(ニックネーム)

-

性別: +性別

-

年代: +年代

-

出身地: +出身地

-

キャラ: +キャラ

-

(好きなキャラを選んでください)

-
+ + +
diff --git a/oasis2015/prof.rb b/oasis2015/prof.rb index a728719..3ac548e 100755 --- a/oasis2015/prof.rb +++ b/oasis2015/prof.rb @@ -13,24 +13,69 @@ jikan1 = "select * from time where cd = ?" timeupd = "update time set now = ?, id = ? where cd = ?" -# id = cook[0][0] - name = cook[0][1] - cal = cook[0][2] - age = cook[0][3] - sex = cook[0][4] - aria = cook[0][5] - exp = cook[0][6] - pt = cook[0][7] - lv = cook[0][8] +que = "select * from toi where id = ?" +queupd = "update toi set q1 = ?, q2 = ?, q3 = ?, q4 = ?, q5 = ? where id = ?" +toi = db.execute(que, person) +bomd = "update test set pt = ? where id = ?" + +name = cook[0][1] +cal = cook[0][2] +age = cook[0][3] +sex = cook[0][4] +aria = cook[0][5] +exp = cook[0][6] +pt = cook[0][7] +lv = cook[0][8] + + +q1 = toi[0][1] +q2 = toi[0][2] +q3 = toi[0][3] +q4 = toi[0][4] +q5 = toi[0][5] per ="%" +##################--ptを獲得するための乱数生成--############# +##################----############################# + +def qrc() + srand(11223344) + x = rand(10000000) + srand(x) + qrnumber = Hash.new("n") + qrarr = ["a", "b", "c", "d", "e"] + qrarr.length.times do |n| + qrnumber[rand(100000000)] = qrarr[n] + end + return qrnumber +end + ##################ptを獲得した際の反応。#################### #########前の人が書き込んだ時間と比べて60秒以内なら追加ポイント#### -bom = c["bom"] +bom = c["bom"] ####
より if bom == "skip" +jikan2 = db.execute(jikan1, "j") +now1 = jikan2[0][1] +nowper = jikan2[0][2] +now2 = Time.now.to_i +db.execute(timeupd, now2, person, "j") + if person == nowper + elsif now1 == nil + elsif now2-now1 < 3 ####3秒以内なら~ + pt += 20 + end + pt += 1 +# db.execute(bomd, pt, person) +end + +qrAC = qrc ###生成したハッシュには、"乱数"=>"記号"が入っている +getAC = ARGV[0].to_i ###URL?以降の文字(特定の乱数)を取得 +qr = qrAC[getAC] ###特定の"乱数"が一致すると、"乱数"=>"記号"がqrに正しく入力される。 +if qr =="a" && q1 == 0 +q1 += 1 jikan2 = db.execute(jikan1, "a") now1 = jikan2[0][1] nowper = jikan2[0][2] @@ -41,50 +86,116 @@ elsif now2-now1 < 60 pt += 2 end - pt += 10 - bomd = "update test set pt = ? where id = ?" - db.execute(bomd, pt, person) +pt += 10 +elsif qr == "b" && q2 == 0 +q2 += 1 +jikan2 = db.execute(jikan1, "b") +now1 = jikan2[0][1] +nowper = jikan2[0][2] +now2 = Time.now.to_i +db.execute(timeupd, now2, person, "b") + if person == nowper + elsif now1 == nil + elsif now2-now1 < 60 + pt += 2 + end +pt += 10 +elsif qr == "c" && q3 == 0 +q3 += 1 +jikan2 = db.execute(jikan1, "c") +now1 = jikan2[0][1] +nowper = jikan2[0][2] +now2 = Time.now.to_i +db.execute(timeupd, now2, person, "c") + if person == nowper + elsif now1 == nil + elsif now2-now1 < 60 + pt += 2 + end +pt += 10 +elsif qr == "d" && q4 == 0 +q4 += 1 +jikan2 = db.execute(jikan1, "d") +now1 = jikan2[0][1] +nowper = jikan2[0][2] +now2 = Time.now.to_i +db.execute(timeupd, now2, person, "d") + if person == nowper + elsif now1 == nil + elsif now2-now1 < 60 + pt += 2 + end +pt += 10 +elsif qr == "e" && q5 == 0 +q5 += 1 +jikan2 = db.execute(jikan1, "e") +now1 = jikan2[0][1] +nowper = jikan2[0][2] +now2 = Time.now.to_i +db.execute(timeupd, now2, person, "e") + if person == nowper + elsif now1 == nil + elsif now2-now1 < 60 + pt += 2 + end +pt += 10 end -if cal == "snail" -image = "./img/snail.png" +db.execute(bomd, pt, person) +db.execute(queupd, q1, q2, q3, q4, q5, person) + + + + + +########################~ここまでpt処理~################### +####################################################### + +if cal == "inu" + image = "./img/inu#{lv}.png" + alt = "inu#{lv}" elsif cal == "sisip" -image = "./img/sisip.png" + image = "./img/sisip#{lv}.png" + alt = "sisip#{lv}" elsif cal == "kamon" -image = "./img/kamon.png" + image = "./img/kamon#{lv}.png" + alt = "kamon#{lv}" elsif cal == "boy" -image = "./img/boy.png" + image = "./img/boy#{lv}.png" + alt = "boy#{lv}" elsif cal == "girl" -image = "./img/girl.png" + image = "./img/girl#{lv}.png" + alt = "girl#{lv}" else -image = "./image/none.png" + image = "./img/snail.png" end -#さかたぽいんと -gage = 50 #styleのmargin部分。50でちょうど中央。「経験値/必要経験値=いま何パー」のかたちで出力。 -#24/24 = 1 =20 -#22 = 0.916=25 -#20 = 0.833=30 -#18/24 = 0.75 =35 -#16 = 0.666=40 -#14 = 0.583=45 -#12/24 = 0.5 =50 -#10 = 0.416=55 -# 8 = 0.333=60 -# 6/24 = 0.25 =65 -# 4 = 0.166=70 -# 2 = 0.083=75 -# 0/24 = 0 =80 -#marginのleftが20パーであることに留意。(gageがレフトに揃うと(この場合20)で見た感じゲージMAXになる)20~80(79)の値を変動 +#expが10あがる毎にlvが1あがる。 +#expの1の位*10で、次のレベルアップに必要な経験値の割合が出る。 +#(exp=12の場合、2*10=『20%』、次のレベルアップまであと80%が必要、と分かる。) +#(exp=35の場合、5*10=『50%』、次のレベルアップまであと50%が必要、と分かる。) +gage = 100 +exp2 = exp +if lv < 5 +while exp > 10 +exp2 -= 10 +end +gage = 100-exp2*10 +end + +###################################--HTML--################## +###################################--------################## + #以下のprintfについて #pre*4はstyleの部分、

{margin(本来OS_,per,gage,per,per,per,name...) -printf(<<_EOS_, name, lv, exp, pt, image, cal) +printf(<<_EOS_, per, gage, per, per, per, image, alt, name, cal, lv, pt) + @@ -92,29 +203,59 @@ さかたっち + +

+

さかたっち

-

さかたっち~酒田の自然に囲まれて~

-

NAME:%s

+
+
+%s +
+ + + +
name:%s
cal:%s
lv.%d
+
+ +
+

exp

+
+ - +
+

さかたポイント:%dp

+
ごはん!
-たまごのから:1pt
-きゃべつ:3pt
+たまごのから:1pt
+きゃべつ:3pt


+
しょうひん!
おちゃ:3pt
@@ -122,21 +263,14 @@ せんたくせんざい:20pt

- -
+
+
- - - - -
lv:%d
exp:%d
pt:%d
-

lv1

-

%s

skip@xxxx.co.jp
+ diff --git a/oasis2015/profeel.css b/oasis2015/profeel.css index 2f528de..b518849 100644 --- a/oasis2015/profeel.css +++ b/oasis2015/profeel.css @@ -1,2 +1,50 @@ +body{text-align:center; +background:#ffb; +} +header{ +#padding:100px; + position: relative; + top: 0px; + left: 0px; + width: 100%; + height: 100px; +background-image:url(./img/head.png); +text-align:center; +} +footer{ +#padding:100px; + position: relative; + top: 0px; + left: 0px; + width: 100%; + height: 100px; +background-image:url(./img/foot.png); +text-align:center; +} + + + +header p {color:red;} + input[type="checkbox"][name="hdn"] + span {display: none;} input[type="checkbox"][name="hdn"]:checked + span {display: inline;} + +table{margin-left:auto; margin-right: auto;} +table.state{text-align:left;} +table.state tr+tr+tr{font-size:xx-large;} + +div.lets{ +border:solid 2px #fa0; +background:#faf; +padding:2%; +margin:2em 28em; +} +div.lets span{color:navy; text-decoration: underline #faf;} + +div.cal {margin-left:auto; margin-right:auto; +#width: 230px; height: 140px; +background: white} +div.cal div{float:left; border:solid black;} + + +#form{margin-left:auto; margin-right:auto;}