Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. var user = prompt ("What peoples of Middle-Earth do you represent?").toLowerCase();
  2.  
  3. switch (user) {
  4. case 'elves':
  5. var weapon = prompt ("What is your weapon of choice?").toLowerCase();
  6. if (weapon === 'ring' || weapon === 'silmaril') {
  7. console.log ("You are ready to defeat Sauron");
  8. } else { console.log ("Join the fight when you have acquired a proper weapon.");
  9. }
  10. break;
  11. case 'dwarves':
  12. var army = prompt ("To whose army are you loyal?").toLowerCase();
  13. var allegiance = prompt ("Do you still live in Moria? (YES OR NO)").toLowerCase();
  14. if (army === 'durin' && allegiance === 'yes') {
  15. console.log ("Sorry you perish in the mines of Moria");
  16. } else {console.log ("You are ready to fight against the armies of Sauron!");
  17. }
  18. break;
  19. case 'man':
  20. var wraith = prompt ("Are you tempted by mysterious rings of power (yes or no) ?").toLowerCase();
  21. if (wraith === 'yes') {
  22. console.log ("You become a ringwraith cursed to forever serve Sauron and the one ring.") ;
  23. } else {
  24. console.log ("Welcome, second-born!");
  25. }
  26. break;
  27. default:
  28. console.log ("You must be an orc. Away with you spy!");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement