diff --git a/app/stone-origami-sword/app.js b/app/stone-origami-sword/app.js new file mode 100644 index 0000000..6612dff --- /dev/null +++ b/app/stone-origami-sword/app.js @@ -0,0 +1,100 @@ +function randomNumber(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; +} +//Randomizer I copied from the internet + +var output = ''; +var win = 0; +var rounds = 0; +var winr = 0; +//Variables + +function rockButton() { + output = ''; + document.getElementById('rock').style.border = "3px solid #333333"; + document.getElementById('paper').style.border = "3px solid #000000"; + document.getElementById('scissors').style.border = "3px solid #000000"; + output += 1; +} + +function paperButton() { + output = ''; + document.getElementById('paper').style.border = "3px solid #333333"; + document.getElementById('rock').style.border = "3px solid #000000"; + document.getElementById('scissors').style.border = "3px solid #000000"; + output += 2; +} + +function scissorsButton() { + output = ''; + document.getElementById('scissors').style.border = "3px solid #333333"; + document.getElementById('rock').style.border = "3px solid #000000"; + document.getElementById('paper').style.border = "3px solid #000000"; + output += 3; +} +//Buttons for the options + +function button() { + var bot = (randomNumber(1, 3)); + var final = output / bot; + + switch (bot) { + case 1: + document.getElementById("bot").innerHTML = "Bot chose stone."; + break; + case 2: + document.getElementById("bot").innerHTML = "Bot chose origami."; + break; + case 3: + document.getElementById("bot").innerHTML = "Bot chose sword."; + break; + } + + switch (final) { + case 1: + document.getElementById("answer").innerHTML = "Tie"; + break; + case 0.5: + document.getElementById("answer").innerHTML = "You chose stone and lost..."; + rounds += 1; + break; + case 0.3333333333333333: + document.getElementById("answer").innerHTML = "You chose stone and won!"; + win += 1; + rounds += 1; + break; + case 2: + document.getElementById("answer").innerHTML = "You chose origami and won!"; + win += 1; + rounds += 1; + break; + case 0.6666666666666666: + document.getElementById("answer").innerHTML = "You chose origami and lost..."; + rounds += 1; + break; + case 3: + document.getElementById("answer").innerHTML = "You chose sword and lost..."; + rounds += 1; + break; + case 1.5: + document.getElementById("answer").innerHTML = "You chose sword and won!"; + win += 1; + rounds += 1; + break; + case 0: + document.getElementById("answer").innerHTML = "You didn't pick anything."; + } + //Yikes that's a lot of cases and repetition + if (rounds >= 1) { + winr = Math.round(win/rounds*100); + document.getElementById("winrate").innerHTML = "Winrate: " + winr + "%"; + } else { + document.getElementById("winrate").innerHTML = "Winrate:"; + } + //I made this in like 2 minutes there's probably a more efficient way to calculate without it breaking + +} + +//Probably too many functions in a button but that's only way I know how to update page on press \ No newline at end of file diff --git a/app/stone-origami-sword/icon.png b/app/stone-origami-sword/icon.png new file mode 100644 index 0000000..599d8f0 Binary files /dev/null and b/app/stone-origami-sword/icon.png differ diff --git a/app/stone-origami-sword/index.php b/app/stone-origami-sword/index.php index 5ddbe1d..ea0b77e 100644 --- a/app/stone-origami-sword/index.php +++ b/app/stone-origami-sword/index.php @@ -1,68 +1,68 @@ - - - - - - - - - - S.O.S. - Misdew - - - - -
- - -
- - - Misdew -
-
- - - - - - -
RockPaperScissors
- -
- -
Good luck.
- -
- -

-
-
- - - - - -
- - + + + + + + + + + + S.O.S. - Misdew + + + + +
+ + +
+ + + Misdew +
+
+ + + + + + +
RockPaperScissors
+ +
+ +
Good luck.
+ +
+ +

+
+
+ + + + + +
+ + diff --git a/app/stone-origami-sword/info.php b/app/stone-origami-sword/info.php new file mode 100644 index 0000000..2e968d1 --- /dev/null +++ b/app/stone-origami-sword/info.php @@ -0,0 +1,33 @@ + diff --git a/app/stone-origami-sword/main.css b/app/stone-origami-sword/main.css new file mode 100644 index 0000000..90248c6 --- /dev/null +++ b/app/stone-origami-sword/main.css @@ -0,0 +1,66 @@ +@import url('https://fonts.googleapis.com/css?family=Dosis:400,700'); +th { + width: 200px; + height: 200px; + padding: 10px; + border-radius: 100%; +} + +img { + width: 200px; + height: 200px; + padding: 10px; +} + +body { + background-color: #000000; + margin: 0px; + font-family: 'Dosis', sans-serif; +} + +.title { + background-color: #000000 !important; + width: 100%; + margin-top: 15px; + margin-left: 0px; + margin-right: 0px; + margin-bottom: 10px; + height: 70px; + padding: 0px; + text-align: center; + color: #333333; + font-size: 45px; + line-height: 60px; + font-family: 'Dosis', sans-serif; +} + +#rock, #paper, #scissors { + border: 3px solid #000000; +} + +* { + font-family: 'Dosis', sans-serif; +} + +#answer, #bot, #winStatic, #winrate { + color: #333333; + font-size: 30px; +} + +#buttonDiv { + height: 66px; + width: 150px; + background-color: #000000; + border-radius: 5em; + border: 2px solid #333333; + line-height: 40px; + font-size: 25px; + color: #333333; + font-family: 'Dosis', sans-serif; +} + +#patch { + color: white; + background-color: #2c2c2c; + text-decoration: underline; +} diff --git a/app/stone-origami-sword/paper.png b/app/stone-origami-sword/paper.png new file mode 100644 index 0000000..3dfaee7 Binary files /dev/null and b/app/stone-origami-sword/paper.png differ diff --git a/app/stone-origami-sword/rock.png b/app/stone-origami-sword/rock.png new file mode 100644 index 0000000..56a7c9f Binary files /dev/null and b/app/stone-origami-sword/rock.png differ diff --git a/app/stone-origami-sword/scissors.png b/app/stone-origami-sword/scissors.png new file mode 100644 index 0000000..881b8fa Binary files /dev/null and b/app/stone-origami-sword/scissors.png differ