javascript - A small code to impress friends is int working -
ok, im beginner, working javascript. im making small game impress friends, , reason, code isnt working. part of code, part has deal isnt working. when run it, doesn't go else command, if dont type stay, tell me why? here is:
var qestionone = prompt("an old man emerges shadows of forest standing in. farther ahead, can see forest breaks up, , trees become less , less thick. if squint, can see small town. * chose either, stay, , talk old man, or leave, , continue down path following, , go town? *"); if (questionone = "stay") { alert("the old man approaches you, , speaks. 'i must warn you, there trap @ end of forest. undergrowth thins,there horrable , evil sludge monster. please, go around' old man rasped. thankfull information, proceed journey, , avoid big portion of forest ahead."); } else { alert("you travel ahead, down path. suddenlly become hungry. notice trees around have juicy looking fruit on branches.you have never seen type of food before, however, a..fruit-toligist...and know poiseness fruit have yellow , black stripes. pluck 1 off of nearby tree , hungrily munch foreign food. loud screeching sound interupts thoughts on filling stomache, , directs eyes behind you."); }
var questionone = prompt("an old man emerges shadows of forest standing in. farther ahead, can see forest breaks up, , trees become less , less thick. if squint, can see small town. * chose either, stay, , talk old man, or leave, , continue down path following, , go town? *"); if (questionone == "stay") { alert("the old man approaches you, , speaks. 'i must warn you, there trap @ end of forest. undergrowth thins,there horrable , evil sludge monster. please, go around' old man rasped. thankfull information, proceed journey, , avoid big portion of forest ahead."); } else { alert("you travel ahead, down path. suddenlly become hungry. notice trees around have juicy looking fruit on branches.you have never seen type of food before, however, a..fruit-toligist...and know poiseness fruit have yellow , black stripes. pluck 1 off of nearby tree , hungrily munch foreign food. loud screeching sound interupts thoughts on filling stomache, , directs eyes behind you."); }
two problems: typo in questionone, , using = intead of ==
Comments
Post a Comment