Beispiel #1
0
        public ActionResult Update(string guess, int gameid)
        {
            char      newGuess     = guess[0];
            bool      resultFound  = false;
            GameClass selectedGame = GameClass.Find(gameid);

            foreach (Letter candidate in selectedGame.Letters)
            {
                if (newGuess == candidate.LetterOfWord)
                {
                    candidate.Visible = true;
                    resultFound       = true;
                }
            }
            if (!resultFound)
            {
                selectedGame.FailsRemaining -= 1;
            }
            return(RedirectToAction("Show", gameid));
        }
Beispiel #2
0
        public ActionResult Show(int id)
        {
            GameClass selectedGame = GameClass.Find(id);

            return(View("Show", selectedGame));
        }