Very Simple Word Game Code Executes As Text :(
I am so sorry for yet another nooby thread, but I am just starting out and having a few teething problems.
I have tried a few things with the following, but nothing seems to work. I have tried <script> tags, and different browsers. A friend told me it executes fine.
Here is the code. Please don't judge. This is my first ever self-wrote code. I know it sounds crap (especially towards the end when I just wanted to put any text in to check the multiple if statement). Anyhow, here is my code:
var age = prompt("How old are you?");
if( age < 18)
alert("You are to young to play this game!");
alert("Enjoy the game");
alert("You're walking down the street and come to a fork. To the right you see beautiful streams,\
and rolling countryside. To the left, dead trees, rain, sleet, and misery. Which way would you like\
var choiceOne = prompt("left (press 1) or right (press 2)?");
if(choiceOne == "1")
alert("As you begin your path the rain pelts hard against your face. You are beginning to regret your decision, but\
still feel you made the right choice. You hear a cackling laugh coming from behind a nearby tree.");
var choiceTwo = promt("Investigate the laugh (press 1) or ignore (press 2)?")
if(choiceTwo = "1")
alert("out jumps a monster and eats you"); //fix this Mikey FFS!
alert("Feeling the warm sun on your face you allow yourself a wry smile. The bird song in your ears and the scent of flowers in your nose.");
how to get an array position inside another array