<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
alert("Welcome traveler! Please type all responses in lowercase. These are the end of the instructions.")
alert("Oh, and thanks for playing...")
var response = prompt("Please choose a class... warrior, ranger, mage, or cleric.")
if (response === "mage"){
alert("Here is a staff for your journey! Use it wisely.")
var clericMage = prompt("Which way will you head first? left or right?")
}
else if (response === "cleric"){
alert("Here is a staff for your journey! Use it wisely.")
var clericMage = prompt("Which way will you head first? left or right?")
}
else if(response === "warrior"){
alert("You have been given the choice between a short sword or long sword.")
var warrior = prompt("Which will you choose? The short sword or the long sword.")
}
else if(response === "ranger"){
alert("You have been given the choice between a short bow or long bow.")
var ranger = prompt("Which will you choose? The short bow or the long bow.")
}
else{
alert("Try again.")
}
//CLERIC MAGE ROUTE
if (clericMage === "right"){
alert("You enter a large room filled with gold coins and goblets.")
alert("Looking around you notice a large pile at the center of the room. The pile appears to be breathing...")
var clericMageResponse1 = prompt("Would you like to aquire some gold for your journey? Yes or no.")
}
else if(clericMage === "left"){
alert("You find yourself running down a long hallway.")
alert("At the end of the hallway you exit into a large colosseum filled with light.")
alert("Standing in the middle of the arena is a large one eyed cyclops.")
var clericMageResponse2 = prompt("What will you do? wand or diplomacy?")
}
if (clericMageResponse1 === "yes"){
alert("You grab a singular gold coin from the pile.")
alert("The pile at the middle of the room stirs...")
var dragon = prompt("Would you like to take another or leave the room? yes or no.")
}
else if (clericMageResponse1 === "no"){
alert("You leave the room with haste.")
var hallway = prompt("At the end of a long hallway you spot two doors. One beaming with light and the other dark and cold. Which will you choose? left or right.")
}
if(clericMageResponse2 === "wand"){
alert("You shout avada kadavra at the cyclops with great passion!!!")
alert("Nothing happens...")
alert("The cyclops proceeds to end your journey with one swing.")
alert("You die.")
}
else if(clericMageResponse2 === "diplomacy"){
alert("You sit down with the giant to discuss the terms of his surrender.")
alert("He is a very reasonable man and understands how powerful you could potentially be.")
alert("Though still not convinced to let you through he ask what you have to offer him.")
var diplomacy = prompt("Would you like to give him your gold piece? yes or no.")
}
if (diplomacy === "yes"){
alert("You win the game! Not resporting to violence was very cleric mage class of you!")
}
else if (diplomacy === "no"){
alert("The giant grows impatient with your squabble. The cyclops smashes you with his fist.")
alert("You die.")
}
if(dragon === "yes"){
alert("A large plum of fire erupts from the pile scorching your bones.")
alert("You die.")
}
else if(dragon === "no"){
alert("You leave the room with haste.")
var hallway = prompt("At the end of a long hallway you spot two doors. One beaming with light on the left and the other dark and cold on the right. Which will you choose? left or right.")
}
if (hallway === "left"){
alert("A large plum of fire erupts from the doorway scorching your bones.")
alert("You die.")
}
else if (hallway === "right"){
alert("As you enter the room a frost giant greets you.")
alert("He offers you a spot at his table to sit and sip tea with him.")
alert("Being a gentlman mage cleric class you cannot refuse his kind offer!")
alert("You sit down.")
alert("As you drink tea with the giant he tells you all about his homeland.")
alert("The tea was poisoned.")
alert("You die.")
}
//WARRIOR ROUTE
if (warrior === "short sword"){
alert("You obtained the copper short sword. It's very weak, but now you have the option to run from battle. ")
var warriorPath1 = prompt("You find a small rabbit. It's not hostile, but you have to get EXP somehow. Which do you choose, kill it or befriend it.")
}
if (warriorPath1 === "kill it"){
alert("It wasn't hostile, but it was level 100. You died!")
}
else if (warriorPath1 === "befriend it"){
alert("It worked! You have now befriended the small rabbit.")
var RabbitName = prompt("What is your new friend's name?")
alert("That's a nice name.")
var warriorPath1 = prompt("You and " + RabbitName + (" journey further into the forest. You end up finding the spooky ruins of Icantthinkofaname. Do you want to explore these? Yes or no. "))
}
if(warriorPath1 === "no"){
alert("Boooring.")
}
else if (warriorPath1 === "yes"){
var warriorPath1 = prompt("You choose to explore the spooky ruins. Right before the giant stone door you see a welcome mat. Should you check under the welcome mat for a key? Check or don't check.")
}
if(warriorPath1 === "check"){
alert("There was a key, but it wasn't to the door, so you went inside anyway because the door was unlocked.")
var warriorPath1 = prompt("You walk in the building and see an obvious arrow trap. Walk around or walk over.")
}
if(warriorPath1 === "don't check"){
alert("The door was unlocked anyway, so you venture further in.")
var warriorPath1 = prompt("You walk in the building and see an obvious arrow trap. Walk around or walk over.")
}
if(warriorPath1 === "walk over"){
alert("You were killed by an arrow.")
}
if(warriorPath1 === "walk around"){
alert("You avoided the smelly arrow trap.")
var warriorPath1 = prompt("You enter a smelly room and find the Smelly Goblin. Kill him or give him cologne?")
}
if(warriorPath1 === "kill him"){
alert("His blood is on your hands...")
alert("The next room you enter is filled with goblins.")
alert("They see the blood on your hands.")
alert("They know what you did...")
alert("They rejoiced as the smelly goblin kept stinking up the place.")
alert("You won! (Warrior Ending 1/2)")
}
if(warriorPath1 === "give him cologne"){
alert("The Smelly Goblin is shocked by your act of kindness. He is so happy that he joins your party (whether you want him to or not...) ")
var GoblinName = prompt("What is the Smelly Goblin's name?")
alert("+ 15 smell points")
alert("You, " + RabbitName + ", and " + GoblinName +" escaped the ruins and saw an open field." )
alert("You and your new buds had a nice picnic." )
alert("You won! (Warrior Ending 2/2) For the final ending, say type the word finale for the next question.")
var secret = prompt("Password?")
}
else if (warrior === "long sword"){
alert("You obtained the Comically Large Sword. It's very strong, but you can not run from a fight.")
alert("Your sword was too big and you couldn't carry it. Instead you just died.")
}
//RANGER ROUTE
if (ranger === "short bow"){
alert("You obtained the epic short bow. It's very weak, but now you have the option to run from battle. ")
var rangerPath1 = prompt("You find a small turtle. It's not hostile, but you have to get EXP somehow. Which do you choose, kill it or befriend it.")
}
if (rangerPath1 === "kill it"){
alert("It wasn't hostile, but it was level 100. You died!")
}
else if (rangerPath1 === "befriend it"){
alert("It worked! You have now befriended the small turtle.")
var TurtleName = prompt("What is your new friend's name?")
alert("That's a nice name.")
var rangerPath1 = prompt("You and " + TurtleName + (" journey further into the forest. You end up finding the spooky ruins of Icantthinkofaname. Do you want to explore these? Yes or no. "))
}
if(rangerPath1 === "no"){
alert("Boooring.")
}
else if (rangerPath1 === "yes"){
var rangerPath1 = prompt("You choose to explore the spooky ruins. Right before the giant stone door you see a welcome mat. Should you check under the welcome mat for a key? Check or don't check.")
}
if(rangerPath1 === "check"){
alert("There was a key, but it wasn't to the door, so you went inside anyway because the door was unlocked.")
var rangerPath1 = prompt("You walk in the building and see an obvious arrow trap. Walk around or walk over.")
}
if(rangerPath1 === "don't check"){
alert("The door was unlocked anyway, so you venture further in.")
var rangerPath1 = prompt("You walk in the building and see an obvious arrow trap. Walk around or walk over.")
}
if(rangerPath1 === "walk over"){
alert("You were killed by an arrow.")
}
if(rangerPath1 === "walk around"){
alert("You avoided the smelly arrow trap.")
var rangerPath1 = prompt("You enter a smelly room and find the Smelly Troll. Kill him or give him cologne?")
}
if(rangerPath1 === "kill him"){
alert("His blood is on your hands...")
alert("The next room you enter is filled with trolls.")
alert("They see the blood on your hands.")
alert("They know what you did...")
alert("They rejoiced as the smelly troll kept stinking up the place.")
alert("You won! (Ranger Ending 1/2)")
}
if(rangerPath1 === "give him cologne"){
alert("The Smelly Troll is shocked by your act of kindness. He is so happy that he joins your party (whether you want him to or not...) ")
var TrollName = prompt("What is the Smelly Troll's name?")
alert("+ 15 smell points")
alert("You, " + TurtleName + ", and " + TrollName +" escaped the ruins and saw an open field." )
alert("You and your new buds had a nice walk." )
alert("You won! (Ranger Ending 2/2)")
}
else if (ranger === "long bow"){
alert("You obtained the Comically Large Bow. It's very strong, but you can not run from a fight.")
alert("Your bow was too big and you couldn't carry it. Instead you just died.")
}
if (secret === "finale"){
alert("ENTERING FINALE MODE")
var name = prompt("Welcome to the finale... before we continue... what is your name?")
alert("...")
alert(".........")
alert(name + ".")
alert("Interesting...")
alert("...")
var tellMe = prompt("Tell me... are you ready? Yes or no.")
alert("It doesn't matter.")
alert("You will never be ready... for what happens next...")
alert("it will shake you to your core")
alert("...")
alert("Get ready.")
alert("...")
alert(name + " is a stinky poopoo buttfart.")
alert("!")
alert(name + " took critical damage!")
var RPG = prompt("Javascript Attacks! Enemy Hp: 150 Options: Attack, Spell, Heal, Shoot")
alert("You tried to pull yourself together, but you were too weak.")
alert("Javascript: 'How embarrassing...'")
alert("Javascript readied the killing blow!")
var RPG = prompt("Target: Javascript Enemy Hp: 150 Options: Attack, Spell, Heal, Shoot")
alert("...but you were powerless")
alert("Javascript: 'Prepare to die!'")
alert("Javascript fired his death laser!")
alert("Suddenly " + GoblinName + " jumped in front of the beam!")
alert("Critical damage to " + GoblinName + "!")
alert("Enraged by your dear freind's sacrifice, you were encouraged to keep fighting.")
var RPG = prompt("Target: Javascript Enemy Hp: 150 Options: Attack")
}
if (RPG === "attack"){
alert("Javascript took 27 damage!")
alert("Javascript spits on the Smelly Goblin's grave.")
alert("Suddenly you felt something move in your pocket.")
alert("It was " + RabbitName + "!")
alert("Suddenly your rabbit friend emitted a bright light")
alert("Your frined soon grew to a massive scale!")
alert(RabbitName + " The Ascended joined your party!")
var RPGTwo = prompt("Target: Javascript Enemy Hp: 123 Options: Killshot")
}
if (RPGTwo === "killshot"){
alert("437383 damage to Javascript!")
alert("Javascript: 'No, nonono, NOOOOOOO!!!!'")
alert("Javascript was defeated!")
alert("Universe Reset in 10")
alert("9")
alert("8")
alert("7")
alert("6")
alert("5")
alert("4")
alert("3")
alert("2")
alert("1")
alert(" ")
alert(" ")
alert(" ")
alert(" ")
alert("Welcome traveler! Please type all responses in lowercase. These are the end of the instructions.")
alert("Also...")
alert("I know who you are " + name + ".")
alert("Alright you can stop playing the game now.")
}
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |