Exemplo n.º 1
0
        public GameResult Evaluate(MineField mineField)
        {
            var covers = Covers();

            return(new GameResult(
                       mineField
                       .Mines()
                       .Any(mine => !covers.IsCovered(mine)),
                       covers.CoverCount() - mineField.Mines().Count()));
        }
Exemplo n.º 2
0
 public static GameState Quit(GameState current, MineField mineField)
 {
     return(current.Do(
                current
                .Covers()
                .UncoverRange(
                    mineField.Mines())));
 }