diff --git a/1.png b/1.png new file mode 100644 index 0000000..eebd154 --- /dev/null +++ b/1.png Binary files differ diff --git a/2.png b/2.png new file mode 100644 index 0000000..fac9400 --- /dev/null +++ b/2.png Binary files differ diff --git a/3.png b/3.png new file mode 100644 index 0000000..6ab2622 --- /dev/null +++ b/3.png Binary files differ diff --git a/4.png b/4.png new file mode 100644 index 0000000..eebd154 --- /dev/null +++ b/4.png Binary files differ diff --git a/5.png b/5.png new file mode 100644 index 0000000..fac9400 --- /dev/null +++ b/5.png Binary files differ diff --git a/6.png b/6.png new file mode 100644 index 0000000..6ab2622 --- /dev/null +++ b/6.png Binary files differ diff --git a/7.png b/7.png new file mode 100644 index 0000000..eebd154 --- /dev/null +++ b/7.png Binary files differ diff --git a/8.png b/8.png new file mode 100644 index 0000000..fac9400 --- /dev/null +++ b/8.png Binary files differ diff --git a/9.png b/9.png new file mode 100644 index 0000000..6ab2622 --- /dev/null +++ b/9.png Binary files differ diff --git a/GDL.css b/GDL.css new file mode 100644 index 0000000..dd3a574 --- /dev/null +++ b/GDL.css @@ -0,0 +1,19 @@ +body{ + background-color: rgba(85, 189, 85, 0.801); +} + + +.honbun{ + text-align: center; + +} +.zyanken{ + + width:160px; + height:90px; +} + +.waku{ + display: flex; + +} \ No newline at end of file diff --git a/GDL.html b/GDL.html new file mode 100644 index 0000000..bf48d78 --- /dev/null +++ b/GDL.html @@ -0,0 +1,59 @@ + + + + + + + + + 限定じゃんけん + + +
+
+

限定じゃんけん

+

ルール説明

+

9枚のカードがかかれたカードがランダムで配布されそのカードでじゃんけんをし、勝ち点だけてんすうがもらえる

+

+

+
+

残りのカード

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

相手のカード

+
+
+
+
+ +
+
+

自分のカード

+
+
+
+
+
+
+
+

勝ち点

+

0

+
+
+
+ + \ No newline at end of file diff --git a/GDL.js b/GDL.js new file mode 100644 index 0000000..7f2736a --- /dev/null +++ b/GDL.js @@ -0,0 +1,131 @@ +function main(){ + var count = 0, + randoms = [], + randoms2 = [], + min = 1, + max = 9, + ten = document.getElementById("ten"), + button = document.getElementById("start"), + elems = []; + for (let i = 0; i <= 14; i++){ //idの取得 + elems[i] = document.getElementById(i); + elems[i].src; + } + + + function doReload() { + // reloadメソッドによりページをリロード + window.location.reload(true); + } + reset.addEventListener("click", doReload, false) //resetボタンが押されたらdoReloadを実行 + + function dostart() { + button.disabled = "true";// ボタンを使用不可にする + for(let i = min; i <= max; i++){ + while(true){ + var tmp = intRandom(min, max); + if(!randoms.includes(tmp)){ + randoms.push(tmp); + break; + } + } + } + + for(let i = min; i <= max; i++){ + while(true){ + var tmp2 =intRandom2(min, max) -1; + if(!randoms2.includes(tmp2)){ + randoms2.push(tmp2); + console.log(randoms2[i - 1]); + break; + } + } + } + + function intRandom(min, max){ + return Math.floor( Math.random() * (max - min + 1)) + min; + } + function intRandom2(min, max){ + return Math.floor( Math.random() * (max - min + 1)) + min; + } + + for(let i = 0; i <= 8; i++){ + elems[i].src = "./"+ String(randoms[i]) + ".png"; + } + for(let i = 0; i <= 2; i++){ + elems[i + 9].src = "./siro.png"; + console.log("自分./"+ String(randoms[randoms2[i]]) + ".png"); + elems[i + 12].src = "./"+ String(randoms[randoms2[i]]) + ".png"; + } + // elems[12]の手札を使ったら勝手に消えるようにする + elems[12].addEventListener("click", rock12,false); + function rock12(){ + elems[12].src = ""; + + if(randoms[randoms2[0]] == 1 || randoms[randoms2[0]] ==4 || randoms[randoms2[0]] ==7){ + if(randoms[randoms2[3]] == 2 || randoms[randoms2[3]] == 5 || randoms[randoms2[3]] == 8){ + wincount(); + } + }else if(randoms[randoms2[0]] == 2 || randoms[randoms2[0]] ==5 || randoms[randoms2[0]] ==8){ + if(randoms[randoms2[3]] == 3 || randoms[randoms2[3]] == 6 || randoms[randoms2[3]] == 9){ + wincount(); + } + }else if(randoms[randoms2[0]] == 3 || randoms[randoms2[0]] ==6 || randoms[randoms2[0]] ==9){ + if(randoms[randoms2[3]] == 1 || randoms[randoms2[3]] == 4 || randoms[randoms2[3]] == 7){ + wincount(); + } + } + console.log("./"+ String(randoms[randoms2[3]]) + ".png"); + elems[9].src = "./"+ String(randoms[randoms2[3]]) + ".png"; + + } + // elems[13]の手札を使ったら勝手に消えるようにする + elems[13].addEventListener("click", rock13,false); + function rock13(){ + elems[13].src = ""; + if(randoms[randoms2[1]] == 1 || randoms[randoms2[1]] ==4 || randoms[randoms2[1]] ==7){ + if(randoms[randoms2[4]] == 2 || randoms[randoms2[4]] == 5 || randoms[randoms2[4]] == 8){ + wincount(); + } + }else if(randoms[randoms2[1]] == 2 || randoms[randoms2[1]] ==5 || randoms[randoms2[1]] ==8){ + if(randoms[randoms2[4]] == 3 || randoms[randoms2[4]] == 6 || randoms[randoms2[4]] == 9){ + wincount(); + } + }else if(randoms[randoms2[1]] == 3 || randoms[randoms2[1]] ==6 || randoms[randoms2[1]] ==9){ + if(randoms[randoms2[4]] == 1 || randoms[randoms2[4]] == 4 || randoms[randoms2[4]] == 7){ + wincount(); + } + } + console.log("./"+ String(randoms[randoms2[4]]) + ".png"); + elems[10].src = "./"+ String(randoms[randoms2[4]]) + ".png"; + } + // elems[14]の手札を使ったら勝手に消えるようにする + elems[14].addEventListener("click", rock14,false); + function rock14(){ + elems[14].src = ""; + if(randoms[randoms2[2]] == 1 || randoms[randoms2[2]] == 4 || randoms[randoms2[2]] == 7){ + if(randoms[randoms2[5]] == 2 || randoms[randoms2[5]] == 5 || randoms[randoms2[5]] == 8){ + wincount(); + } + }else if(randoms[randoms2[2]] == 2 || randoms[randoms2[2]] == 5 || randoms[randoms2[2]] == 8){ + if(randoms[randoms2[5]] == 3 || randoms[randoms2[5]] == 6 || randoms[randoms2[5]] == 9){ + wincount(); + } + }else if(randoms[randoms2[2]] == 3 || randoms[randoms2[2]] == 6 || randoms[randoms2[2]] == 9){ + if(randoms[randoms2[5]] == 1 || randoms[randoms2[5]] == 4 || randoms[randoms2[5]] == 7){ + wincount(); + } + } + console.log("./"+ String(randoms[randoms2[5]]) + ".png"); + elems[11].src = "./"+ String(randoms[randoms2[5]]) + ".png"; + } + } + button.addEventListener("click", dostart, false); +}; +document.addEventListener("DOMContentLoaded", main, false); + +var count = 0; +function wincount(){ + count++; + ten.innerText = String(count); +} \ No newline at end of file diff --git a/siro.png b/siro.png new file mode 100644 index 0000000..f085079 --- /dev/null +++ b/siro.png Binary files differ