public ActionResult HumanPlay(string ID1) { HumanMatch m = new HumanMatch(ID1); m.Make(); Session["PVAGame"] = m; return(View("HumanBoard")); }
public ActionResult HumanMove(string ID) { HumanMatch m = (HumanMatch)Session["PVAGame"]; m.HumanMove(ID.Split('|')[0], ID.Split('|')[1]); var game = m.Read(); if (!game.Contains('|')) { game = game.Replace("-1", " White").Replace("1", " Black"); m.End(); } return(Json(new { moves = game, result = game, gameEnd = !game.Contains('|') })); }