//Level 4 public ActionResult PossiblPath() { AllPossiblePaths obOfAllPossiblePaths = new AllPossiblePaths { Length = 3, Breath = 3, TotalPossiblePaths = 0 }; return(View(obOfAllPossiblePaths)); }
public ActionResult Find_AllPossibePaths(FormCollection c) { int Userans = int.Parse(Request.Form["userAns"]); //int breath = int.Parse(Request.Form["Breath"]); AllPossiblePaths obOfAllPossiblePaths = new AllPossiblePaths { Length = 3, Breath = 3, TotalPossiblePaths = Userans }; //obOfAllPossiblePaths.Length = 3; //obOfAllPossiblePaths.Breath = 3; obOfAllPossiblePaths.TotalPossiblePaths = Userans; int totalPossiblePaths = obOfAllPossiblePaths.CountAllPossiblePaths(obOfAllPossiblePaths); if (totalPossiblePaths == Userans) { return(RedirectToAction("Congratulations")); } else { ViewBag.Message = "Oops ! Wrong Answer, try again "; } return(View(obOfAllPossiblePaths)); }
static void Main(string[] args) { AllPossiblePaths nestedLoops = new AllPossiblePaths(); nestedLoops.RunTask(); }