I have previously said that I am making a game that is text based with javascript, and I got a bunch of helpful replies, which told me to use a loop, but I do not know what loop exactly to use and how. Here is the context that I am using it in:
Please help. Thanks in advance.
Code:
var turn=prompt("Where do you want to turn? Left or right?");
if (turn=="left"){
window.alert("You chose to turn left!");
window.location="somepage1.html";
}
if (turn=="right"){
window.alert("You chose to turn right!");
window.location="somepage2.html";
Comment