duelleonion

rock paper kill la kill

Mar 1st, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var outcomes= { "rock: scissors, scissors: paper, paper: rock," };
  2. console.log ("REBEL ONE!")
  3. var myInput= prompt("Choose your weapon");
  4. if (Object.keys(outcomes) .indexOf(myInput.toLowerCase()) > -1)
  5. {
  6. var aiInput= Object.keys(outcomes) [Math.floor((Math.random() * 3) + 1) - 1];
  7. console.log ("AI chooses %s" aiInput);
  8. if (myInput===aiInput){
  9.     console.log ("It's a tie, you both fucked up!");
  10. }
  11. else {
  12.     if (outcomes [myInput] === aiInput)
  13.     console.log ("Victory!"); }
  14.     else {
  15.         console.log("AI Wins!"); }
  16. }
  17. }
  18. else {
  19.     console.log ("You fucked up at rock, paper, scissors. What are you a programmer? Your mother must be so proud!"); }
  20. //SyntaxError: missing : after property id
Advertisement
Add Comment
Please, Sign In to add comment