forked from hironomiu-vg/rsp_pair_programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hironomiu-vg#68 create dir and files
- Loading branch information
Showing
18 changed files
with
18,385 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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+ "分"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>© 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> |