diff --git a/real_code/hello.css b/real_code/hello.css new file mode 100644 index 0000000..b81eeee --- /dev/null +++ b/real_code/hello.css @@ -0,0 +1,15 @@ +#rock,#paper,#scissors { + height: 100px; + width: 100px; + border: 20px; + border-radius: 50px; +} +#rock { + +} +#paper { + +} +#scissors { + +} \ No newline at end of file diff --git a/real_code/hello.html b/real_code/hello.html new file mode 100644 index 0000000..deffe87 --- /dev/null +++ b/real_code/hello.html @@ -0,0 +1,10 @@ + + + + + Rock,Paper,Scissors + + + + + \ No newline at end of file diff --git a/real_code/hello.js b/real_code/hello.js new file mode 100644 index 0000000..192e11d --- /dev/null +++ b/real_code/hello.js @@ -0,0 +1,35 @@ +$(document).ready(function(){ + var userChoice = prompt("Do you choose rock, paper or scissors?"); + var computerChoice = Math.random(); + + + +if (computerChoice < 0.34) { + computerChoice = "rock"; +} else if(computerChoice <= 0.67) { + computerChoice = "paper"; +} else { + computerChoice = "scissors"; +} console.log("Computer: " + computerChoice); +var compare = function(choice1,choice2) { + if(userChoice === computerChoice) { + return "The result is a tie!"; + }; + if(choice2 === "scissors") { + return "scissors wins"; + $('body').append("scissors wins"); +} +else { + return "paper wins"; + $('body').append("paper wins"); +} +if(choice2 === "scissors") { + return "rock wins"; + $('body').append("rock wins"); +} +else { + return "scissors wins"; + $("body").append("scissors wins"); +} +}; +}); \ No newline at end of file