void Run(TextReader input, TextWriter output) { var ser = new BoardSerializer(); var brd = ser.Deserialize(input); int p = Convert.ToInt32(input.ReadLine()); var currentColor = (ChessColor)Enum.Parse(typeof(ChessColor), input.ReadLine()); for (int i = 0; i < p; i++) { var crds = input.ReadLine().Split('-').Select(x => new { h = x[0] - 'a', v = x[1] - '1' }).ToArray(); var outcome = brd.SmellMove(currentColor, crds[0].h, crds[0].v, crds[1].h, crds[1].v); output.WriteLine(outcome); if (outcome != MoveSmell.Incorrect) { brd.PerformMove(crds[0].h, crds[0].v, crds[1].h, crds[1].v); currentColor = currentColor.Switch(); } if (outcome == MoveSmell.Draw || outcome == MoveSmell.Incorrect || outcome == MoveSmell.Mate) { break; } } output.WriteLine(); ser.Serialize(brd, output); }