Skip to content

Commit

Permalink
hironomiu-vg#68 create dir and files
Browse files Browse the repository at this point in the history
  • Loading branch information
nk-5 committed Jul 12, 2014
1 parent 0961c08 commit 9032e11
Show file tree
Hide file tree
Showing 18 changed files with 18,385 additions and 0 deletions.
442 changes: 442 additions & 0 deletions SKH_branch/css/bootstrap-theme.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions SKH_branch/css/bootstrap-theme.css.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions SKH_branch/css/bootstrap-theme.min.css

Large diffs are not rendered by default.

6,203 changes: 6,203 additions & 0 deletions SKH_branch/css/bootstrap.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions SKH_branch/css/bootstrap.css.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions SKH_branch/css/bootstrap.min.css

Large diffs are not rendered by default.

Binary file added SKH_branch/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
229 changes: 229 additions & 0 deletions SKH_branch/fonts/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SKH_branch/fonts/glyphicons-halflings-regular.ttf
Binary file not shown.
Binary file not shown.
Binary file added SKH_branch/img/paper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SKH_branch/img/rock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SKH_branch/img/scissors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,114 changes: 2,114 additions & 0 deletions SKH_branch/js/bootstrap.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions SKH_branch/js/bootstrap.min.js

Large diffs are not rendered by default.

9,190 changes: 9,190 additions & 0 deletions SKH_branch/js/jquery-2.1.1.js

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions SKH_branch/js/rsp_local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
$(function(){
"use strict";
var HAND_TYPE = {
ROCK : 0,
SCISSORS : 1,
PAPER : 2,
};
var RSP_RESULT_CODE = {
DRAW : 0,
WIN : 1,
LOSE : 2,
};

var draw = 0;
var win = 0;
var lose = 0;

$(".rsp-btn").click(function(){
var result = judge(
myHand($(this).attr("id")),
bobHand()
);
showResult(result);
var seiseki;
showResult(seiseki);
});
function myHand(handType) {
var hand;
if (handType == "rock") {
$("#myrspimg").attr("src", "img/rock.png");
hand = HAND_TYPE.ROCK;
} else if (handType == "scissors") {
$("#myrspimg").attr("src", "img/scissors.png");
hand = HAND_TYPE.SCISSORS;
} else {
$("#myrspimg").attr("src", "img/paper.png");
hand = HAND_TYPE.PAPER;
}
return hand;
}
function bobHand() {
var hand = Math.floor(Math.random() * 3);
if (hand === HAND_TYPE.ROCK) {
$("#bobrspimg").attr("src", "img/rock.png");
} else if (hand === HAND_TYPE.SCISSORS) {
$("#bobrspimg").attr("src", "img/scissors.png");
} else {
$("#bobrspimg").attr("src", "img/paper.png");
}
return hand;
}
function judge(myHand, otherHand) {
var result;
if (myHand === otherHand) {
result = RSP_RESULT_CODE.DRAW;
draw++;
} else if ((myHand === HAND_TYPE.ROCK && otherHand === HAND_TYPE.SCISSORS) || (myHand === HAND_TYPE.SCISSORS && otherHand === HAND_TYPE.PAPER) || (myHand === HAND_TYPE.PAPER && otherHand === HAND_TYPE.ROCK)) {
result = RSP_RESULT_CODE.WIN;
win++;
}else {
result = RSP_RESULT_CODE.LOSE;
lose++;
}
return result;
}
function showResult(result) {
if (result === RSP_RESULT_CODE.DRAW) {
$("#result").text("draw.");
} else if (result === RSP_RESULT_CODE.WIN) {
$("#result").text("You win!");
} else {
$("#result").text("You lose!");
}
$("#seiseki").text("戦績サマリー"+ win +"勝" + lose +"敗" + draw+ "分");
}
});
113 changes: 113 additions & 0 deletions SKH_branch/rsp_local.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">

<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="css/bootstrap-theme.min.css" rel="stylesheet">

<title>じゃんけんゲーム(ローカル版) | VG Tech Dojo</title>

<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">VG-Tech-Dojo</a>
</div>
</div>
</div>

<div class="container-fluid">
<div class="row-fluid">
<div class="content-header">
<h1>じゃんけんゲーム</h1>
</div>
</div>
<hr />
<div class="row">
<div class="col-sm-6">
<div class="row text-center">
<button type="button" class="btn rsp-btn" id="rock">グー</button>
<button type="button" class="btn rsp-btn" id="scissors">チョキ</button>
<button type="button" class="btn rsp-btn" id="paper">パー</button>
</div>
<hr />
<div class="row">
<div class="col-sm-6 text-center">
<p>あなた</p>
<img id="myrspimg" src="img/rock.png" />
</div>
<div class="col-sm-6 text-center">
<p>ボブ</p>
<img id="bobrspimg" src="img/scissors.png" />
</div>
</div>
<hr />
<div class="row">
<p id="result" class="text-center">Who will win?</p>
<p id="seiseki" class="text-center">戦績結果</p>
</div>
</div>
<div class="col-sm-6">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">じゃんけんゲーム</li>
<ul>
<li><h4>ボブとじゃんけん勝負ができます。あなたはグー、チョキ、パーのいずれかのボタンを押すことで出す手を選択できあなたが選択した手と同じ画像が表示され同時にボブがランダムに選択した手と同じ画像が表示されます。あなたとボブの勝敗結果が画像の下に表示されます。</h4></li> <br>
<li>ペアプロ1st(各stepを15分交代で実施)
<ul>
<li>step1: 説明文の表示/非表示を実装しましょう</li>
<li>step2: 勝敗結果の下に戦績(サマリー、履歴)を表示してください。戦績はブラウザを閉じるとリセットされます。戦績サマリーはxx勝xx敗xx分けと表示してください。戦績履歴は1回ごとの自分の手、相手の手、勝敗を表示してください。</li>
<li>step3: スタートボタンを追加しましょう。押すと「じゃんけん」と表示されます。そしてボタンが押されるまでグーチョキパーは押せません。</li>
<li>step4: 勝敗結果を派手にしましょう。画像を入れたり、エフェクトを掛けてみたりペア毎に案を出して実装しましょう</li>
</ul>
</li><br>
<li>グループ開発(step関係なく10分交代で実施)
<ul>
<li>ジャンケンゲームを更に楽しくするアイディアを出しましょう。そしてどのアイディアを実装するかグループで決定しましょう</li>
<ul>
<li>例 対戦相手を複数にし、対戦相手ごとに特徴を出す</li>
<li>例 表示内容を派手にする</li>
</ul>
</li>
</ul>
</li>
</ul>
</ul>
</div>
</div>
</div>
<hr />
<footer>
<p>&copy; VOYAGE GROUP, Inc. All Rights Reserved.</p>
</footer>
</div><!-- /container -->

<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/rsp_local.js"></script>
</body>
</html>

0 comments on commit 9032e11

Please sign in to comment.