Mercurial > hgrepos > hgweb.cgi > skipweb
changeset 3258:bf993ec25da3
tori
author | Minoru Konno <c113069@e.koeki-u.ac.jp> |
---|---|
date | Fri, 15 Jul 2016 16:23:44 +0900 |
parents | 91a5100060da |
children | 857c551a39dc |
files | event/oasis2016/tori/ckgame.rb event/oasis2016/tori/db/point.yaml |
diffstat | 2 files changed, 40 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/event/oasis2016/tori/ckgame.rb Fri Jul 15 14:33:56 2016 +0900 +++ b/event/oasis2016/tori/ckgame.rb Fri Jul 15 16:23:44 2016 +0900 @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- require 'yaml/store' file = "db/point.yaml" -bingoword = %w(a b c d e g) # 正解キーワード9つ +bingoword = %w(1 2 3 4 5 6) # 正解キーワード6つ require 'cgi' c = CGI.new(:accept_charset => "UTF-8") @@ -48,7 +48,7 @@ else # プレイ名設定済みならキーワード入力 title = sprintf("%s さんのホーム", info[id]["name"]) setumei = "海鳥の絵から間違いを3個見つけよう!" - setumei2 = "間違っている絵のパネルは全部で4個あるよ♪" + setumei2 = "間違っている絵のパネルは全部で3個あるよ♪" guide = "キーワードを入れてください" input = '<input name="keyword">' seikai = '<img src="tori.jpg" width="450px" height="450px">' @@ -65,20 +65,20 @@ bingos = info[id]["bingo"].keys.collect do |x| "「" + x + "」"# collectメソッドで 「 」 で括った単語を集めて end.join(", ")# joinメソッドで ,(カンマ) 区切りでつなげる - kaisen = ""; kaisen2 = ""; kaisen3 = ""; kaisen4 = ""; kaisen5 = ""; kaisen6 = '<img src="tori-5.jpg" width="150px" height="225px">'; kaisen7 = ""; kaisen8 = ""; kaisen9 = "" + tori = ""; tori2 = ""; tori3 = ""; tori4 = ""; tori5 = ""; tori6 = "" info[id]["bingo"].keys.each do |f| - if /a/ =~ f - kaisen = '<img src="tori-0.jpg" width="150px" height="225px">' - elsif /b/ =~ f - kaisen2 = '<img src="tori-2.jpg" width="150px" height="225px">'#左下 - elsif /c/ =~ f - kaisen3 = '<img src="tori-3.jpg" width="150px" height="225px">' - elsif /d/ =~ f - kaisen4 = '<img src="tori-1.jpg" width="150px" height="225px">' - elsif /e/ =~ f - kaisen5 = '<img src="tori-4.jpg" width="150px" height="225px">' - elsif /g/ =~ f - kaisen6 = '<img src="tori-5.jpg" width="150px" height="225px">' + if /1/ =~ f + tori = '<img src="tori-0.jpg" width="150px" height="225px">' + elsif /2/ =~ f + tori2 = '<img src="tori-3.jpg" width="150px" height="225px">'#左下 + elsif /3/ =~ f + tori3 = '<img src="tori-1.jpg" width="150px" height="225px">' + elsif /4/ =~ f + tori4 = '<img src="tori-2.jpg" width="150px" height="225px">' + elsif /5/ =~ f + tori5 = '<img src="tori-4.jpg" width="150px" height="225px">' + elsif /6/ =~ f + tori6 = '<img src="tori-5.jpg" width="150px" height="225px">' end end end @@ -88,20 +88,18 @@ <head><title>まちがいみつけでみっちゃ</title> <style type="text/css"> <!-- -div.don { +div.tori { position: relative; width: 450px; height: 450px; border: 1px solid #f9f5a9; margin: 1em auto; } div.tori div {width: 150px; height: 225px; margin: 0px;} -div.tori div:first-child {left: 0px; top: 0px} -div.tori div:nth-child(2) {position: absolute; left: 150px; top: 0px;} -div.tori div:nth-child(3) {position: absolute; left: 0px; top: 225px;} -div.tori div:nth-child(4) {position: absolute; left: 300px; top: 0px;} +div.tori div:first-child {left: 0px; top: 0px;} +div.tori div:nth-child(2) {position: absolute; left: 0px; top: 225px;} +div.tori div:nth-child(3) {position: absolute; left: 150px; top: 0px;} +div.tori div:nth-child(4) {position: absolute; left: 300px; top: 0px;;} div.tori div:nth-child(5) {position: absolute; left: 150px; top: 225px;} -div.tori div:nth-child(7) {position: absolute; left: 300px; top: 225px;} div.tori div:nth-child(6) {position: absolute; left: 300px; top: 225px;} - body{text-align:center; background:#f9f5a9;} --> @@ -120,8 +118,7 @@ <input type="reset" value="リセット"></p> </form> <p>%s</p> -<div class="don"> -<div>%s</div> +<div class="tori"> <div>%s</div> <div>%s</div> <div>%s</div> @@ -131,5 +128,5 @@ </div> </body></html> EOF - title, setumei, setumei2, hello, point, bingoword.length, bingos, guide, input, seikai, kaisen, kaisen4, kaisen7, kaisen2, kaisen5, kaisen8, kaisen6, kaisen3, kaisen9,) + title, setumei, setumei2, hello, point, bingoword.length, bingos, guide, input, seikai, tori, tori2, tori3, tori4, tori5, tori6,) end
--- a/event/oasis2016/tori/db/point.yaml Fri Jul 15 14:33:56 2016 +0900 +++ b/event/oasis2016/tori/db/point.yaml Fri Jul 15 16:23:44 2016 +0900 @@ -4,3 +4,21 @@ name: otamesi bingo: e: true + d: true + c: true + g: true + 1468560307/17010: + name: abc + bingo: {} + 1468563736/50044: + name: "てす" + bingo: {} + 1468563953/17046: + name: "おためし" + bingo: + '1': true + '2': true + '3': true + '4': true + '5': true + '6': true