Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var compare = function(choice1, choice2) {
  2.     if (choice1 === choice2) {
  3.         return "The result is a tie!";
  4.     }else if(choice1 === "paper") {
  5.         if (choice2 === "scissors") {
  6.             return "scissors wins";
  7.         }else{
  8.             return "paper wins";
  9.         }
  10.     }else if(choice1 === "scissors") {
  11.         if (choice2 === "rock") {
  12.         return "rock wins";
  13.         }
  14.     }else{
  15.         return "scissors win";
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement