changeset 559:c512239aa312

Updated
author MURAKAMI Masaki <c112124@h.koeki-u.ac.jp>
date Wed, 23 Jul 2014 19:23:08 +0900
parents d197617be7b9
children 77d367a51b8d
files minato2014/Bingo.css minato2014/Bingo.rb minato2014/accountcheck.rb minato2014/png/UMIMARU.png minato2014/png/pero.png
diffstat 5 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/minato2014/Bingo.css	Wed Jul 23 16:28:10 2014 +0900
+++ b/minato2014/Bingo.css	Wed Jul 23 19:23:08 2014 +0900
@@ -3,7 +3,7 @@
 	  height: 100%;
 }
 div.outflam{
-	width: 720px;
+	width: 800px;
 	height: 1240px;
 	margin-left: auto;
 	margin-right: auto;
@@ -28,7 +28,7 @@
 	margin:0;
 	padding-left: 5%;
 	font-weight: 900;
-	height: 2%;
+	height: 5%;
 	width: 95%;
 	background: #136cf9;
 	border: thin solid #136cf9;
--- a/minato2014/Bingo.rb	Wed Jul 23 16:28:10 2014 +0900
+++ b/minato2014/Bingo.rb	Wed Jul 23 19:23:08 2014 +0900
@@ -100,7 +100,7 @@
 def taiou(sidesize)
   srand(123456789)
   stamp = Hash.new("n")
-  stamp_name = ["kamo", "kite", "mame", "mo2usa", "inuwasi", "hanabu", "be", "UMIMARU", "murakamibot"]
+  stamp_name = ["kamo", "kite", "mame", "mo2usa", "inuwasi", "hanabu", "be", "UMIMARU", "pero"]
   (sidesize**2).times do |n|
     stamp[rand(10000000)] = stamp_name[n]
   end
@@ -203,7 +203,7 @@
 #######
 
 bingo = bingo.length            # ビンゴの数
-
+last_bingo = bingo
 
 if rightAC != "n"               # rightACが正しければ
   
@@ -341,6 +341,13 @@
 '
 # Top message #
 
+bc = bingo.to_i - last_bingo.to_i
+
+if bc > 0
+  message += '<br>おめでとう!' + bc.to_s
+  message += 'ビンゴ揃いました!!<br>'
+end
+
 printf("<p>%s</p>",message)
 
 ##
@@ -399,15 +406,6 @@
 
 charST = rpg(job, sex, stamp, bingo, sumexp)      # ユーザーのキャラクタステータス
 
-bc = charST[2].to_i - last_exp.to_i # expの差
-
-if bc > 5
-  while bc > 5
-    message += 'ビンゴ!<br>'
-    bc -= 5
-  end
-end
-
 ## UPDATE EXP ##
 
 update_exp = 'UPDATE main SET exp=? WHERE id=?;'
@@ -435,7 +433,7 @@
 <div class=\"charSTATUS\">
 ID:%04d<br>
 NAME:%s<br>
-Lv: %d / 全Lv: %d<br>
+あなたのLv: %d / 全員のLv: %d<br>
 当選確率: %3.3f \%
 <div>
 ", charST[0], id,  name, charST[2],sumexp , charST[1])
--- a/minato2014/accountcheck.rb	Wed Jul 23 16:28:10 2014 +0900
+++ b/minato2014/accountcheck.rb	Wed Jul 23 19:23:08 2014 +0900
@@ -10,10 +10,11 @@
 
 begin
   result = db.execute("select * from main;")
+  max = "select max(id) from main where not id='ID';"
 rescue
-  db.execute("create table main(id INTEGER  PRIMARY KEY AUTOINCREMENT,name,sex,age,aria,job,stamp_status,stamp_img,exp,rank,magic)");
+  db.execute("create table main(id INTEGER PRIMARY KEY AUTOINCREMENT,name,sex,age,aria,job,stamp_status,stamp_img,exp,rank,magic)");
   db.execute("insert into main values('ID','名前','性別','年代','住所','職業','スタンプ状況','スタンプ画像','レベル','当選順位','本人確認用')");
-  result = db.execute("select * from main");
+  result = db.execute("select * from main;")
 end
 
 name = c["name"]
@@ -23,7 +24,8 @@
 aria = c["aria"]
 
 code = magic()
-id = result.length
+#id = result.length
+id = db.execute(max).flatten(2)[0] + 1
 #printf("%04d",id)
 
 mg = code[id]
Binary file minato2014/png/UMIMARU.png has changed
Binary file minato2014/png/pero.png has changed

yatex.org