private static bool IsCorrectAnswer(string[] answer) { for (int i = 0; i < correctSolution.Length; i++) { var isCorrect = CompareHelper.AreEqual(answer[i], correctSolution[i]); if (!isCorrect) { return(false); } } return(true); }
public IActionResult OnGet(string answer) { if (!dayValidation.HasAccess(door)) { return(RedirectToPage("Index", new { invalidDoor = door })); } if (string.IsNullOrEmpty(answer)) { return(Page()); } else if (CompareHelper.AreEqual(answer, "library")) { Solved = true; } else { ModelState.AddModelError(string.Empty, $"No, {answer} is not the correct solution."); } return(Page()); }
public IActionResult OnGet(string answer) { if (!dayValidation.HasAccess(door)) { return(RedirectToPage("Index", new { invalidDoor = door })); } if (string.IsNullOrEmpty(answer)) { return(Page()); } if (CompareHelper.AreEqual("inception", answer)) { Solved = true; } else { ModelState.AddModelError(string.Empty, $"The path connection {answer} does not match the available instructions."); } return(Page()); }
public IActionResult OnGet(string answer) { CanSolve = dayValidation.HasAccess(door); if (!CanSolve || string.IsNullOrEmpty(answer)) { return(Page()); } if (CompareHelper.AreEqual(answer, "book")) { ModelState.AddModelError(string.Empty, $"Yeah, it could be a book. But which one, what is the missing book called?"); } else if (CompareHelper.AreEqual(answer, "gilli") || CompareHelper.AreEqual(answer, "seran")) { ModelState.AddModelError(string.Empty, $"No, the book {answer} is on the floor."); } else if (CompareHelper.AreEqual(answer, "sulien")) { ModelState.AddModelError(string.Empty, "I think Odin never owned the fifth book sulien."); } else if (CompareHelper.AreEqual(answer, "ring")) { ModelState.AddModelError(string.Empty, "Are you sure the ring is gone?"); } else if (CompareHelper.AreEqual(answer, "mohidna")) { IsSolved = true; } else { ModelState.AddModelError(string.Empty, $"No, {answer} is not missing."); } Answer = answer; return(Page()); }
public IActionResult OnGet(string answer) { if (!dayValidation.HasAccess(door)) { return(RedirectToPage("Index", new { invalidDoor = door })); } if (string.IsNullOrEmpty(answer)) { return(Page()); } if (CompareHelper.AreEqual("bank", answer)) { Solved = true; } else if (CompareHelper.Contains(listedWords, answer)) { ModelState.AddModelError(string.Empty, $"Just copying a single word from the list wont solve this riddle."); } else { ModelState.AddModelError(string.Empty, $"No, {answer} cannot be the solution."); } return(Page()); }
public IActionResult OnGet(string answer) { if (!dayValidation.HasAccess(door)) { return RedirectToPage("Index", new { invalidDoor = door }); } if (string.IsNullOrEmpty(answer)) { return Page(); } if (CompareHelper.AreEqual("train", answer)) { Solved = true; } else if (CompareHelper.Contains(shapeNames, answer)) { ModelState.AddModelError(string.Empty, $"Repeating the names is not the answer. We need to combine the shape and the number."); } else { ModelState.AddModelError(string.Empty, $"No, {answer} cannot be the solution."); } return Page(); }
public IActionResult OnGet(string answer) { if (!dayValidation.HasAccess(door)) { return(RedirectToPage("Index", new { invalidDoor = door })); } if (string.IsNullOrEmpty(answer)) { return(Page()); } if (CompareHelper.AreEqual(answer, "otis")) { Solved = true; } else if (CompareHelper.AreEqual(answer, "sito")) { ModelState.AddModelError(string.Empty, $"No, {answer} is wrong, what about the item above the numbers?"); } else { ModelState.AddModelError(string.Empty, $"No, {answer} is not the saboteur."); } return(Page()); }
public IActionResult OnGet(string answer) { if (!dayValidation.HasAccess(door)) { return(RedirectToPage("Index", new { invalidDoor = door })); } if (string.IsNullOrEmpty(answer)) { return(Page()); } if (string.Equals(answer, "dollhouse", StringComparison.InvariantCultureIgnoreCase)) { Solved = true; } else if (CompareHelper.AreEqual(answer, "topuvdppuollhideorainoguasmee")) { ModelState.AddModelError(string.Empty, $"His code is not a real christmas whish. His wish must be encrypted inside this code."); } else { ModelState.AddModelError(string.Empty, $"No, {answer} is not the Christmas wish from Juan."); } return(Page()); }