var ans = new Array; var done = new Array; var score = 0; ans[1] = "c"; ans[2] = "a"; ans[3] = "b"; ans[4] = "b"; ans[5] = "c"; ans[6] = "a"; ans[7] = "c"; ans[8] = "b"; ans[9] = "d"; ans[10] = "a"; function Engine(question, answer) { if (answer != ans[question]) { if (!done[question]) { done[question] = -1; alert("Wrong!\n\nYour score is now: " + score); } else { alert("You have already answered that!"); } } else { if (!done[question]) { done[question] = -1; score++; alert("Correct!\n\nYour score is now: " + score); } else { alert("You have already answered that!"); } } } function NextLevel () { if (score > 10) { alert("Cheater!"); } if (score >= 5 && score <= 11) { self.location="http://www.angelfire.com/geek/forustoshowoff/ridkarl.html" } else { alert("Access denied! You need 5 points to enter the next level.") } }