Ejemplo n.º 1
0
        public Piece Run(PieceGrid currentGen, Point point, Piece piece)
        {
            Piece p1 = Rule1.Run(currentGen, point);
            Piece p2 = Rule2.Run(currentGen, point);

            return(p1.StateValue >= p2.StateValue ? p1 : p2);
        }
Ejemplo n.º 2
0
        public Piece Run(PieceGrid currentGen, Point point, Piece piece)
        {
            int aliveNeighbors = PointHelpers.GetAdjacentPointsToroid(point, currentGen, PointHelpers.NeighborhoodOrder.Moore).Count(p => currentGen.PointPieces[p].StateValue > 0);

            switch (piece.StateValue)
            {
            case 0:
                if (aliveNeighbors == 3)
                {
                    return(Piece.Get(1));
                }
                else
                {
                    return(Piece.Get(0));
                }

            case 1:
            default:
                if (aliveNeighbors < 2 || aliveNeighbors > 3)
                {
                    return(Piece.Get(0));
                }
                else
                {
                    return(Piece.Get(1));
                }
            }
        }
Ejemplo n.º 3
0
        bool TrySolve(Piece startPiece)
        {
            var usedPieces = new HashSet <int> {
                startPiece.Id
            };
            var attempt = GetBlankGrid <Piece>(PuzzleSize, null);

            attempt[0][0] = startPiece;
            for (int i = 0; i < PuzzleSize; i++)
            {
                for (int j = 0; j < PuzzleSize; j++)
                {
                    if (i == 0 && j == 0)
                    {
                        continue;
                    }
                    var correctPiece = Pieces
                                       .Where(x => !usedPieces.Contains(x.Id))
                                       .FirstOrDefault(x => CanPlace(x, attempt, i, j));
                    if (correctPiece == null)
                    {
                        return(false);
                    }
                    attempt[i][j] = correctPiece;
                    usedPieces.Add(correctPiece.Id);
                }
            }
            Solution = attempt;
            return(true);
        }
Ejemplo n.º 4
0
        public Piece Run(PieceGrid currentGen, Point point, Piece piece)
        {
            PointHelpers.NeighborhoodOrder neighborhoodOrder;
            if (Neighborhood == CANeighborhood.Moore)
            {
                neighborhoodOrder = PointHelpers.NeighborhoodOrder.MooreRuleTable;
            }
            else
            {
                neighborhoodOrder = PointHelpers.NeighborhoodOrder.VonNeumannRuleTable;
            }
            IEnumerable <Point> neighborhoodPoints = PointHelpers.GetAdjacentPointsToroid(point, currentGen, neighborhoodOrder);
            List <int>          neighborhood       = new List <int>();

            foreach (Point p in neighborhoodPoints)
            {
                neighborhood.Add(currentGen.PointPieces[p].StateValue);
            }

            List <int> sortedNeighborhood = neighborhood.OrderBy(s => s).ToList();

            sortedNeighborhood.Insert(0, piece.StateValue);

            if (RuleDictionary.TryGetValue(GetKeyString(sortedNeighborhood), out int stateValue))
            {
                return(Piece.Get(stateValue));
            }
            else
            {
                return(piece);
            }
        }
Ejemplo n.º 5
0
        public Piece Run(PieceGrid currentGen, Point point, Piece piece)
        {
            int aliveNeighbors = PointHelpers.GetAdjacentPointsToroid(point, currentGen, PointHelpers.NeighborhoodOrder.Moore).Sum(p => currentGen.PointPieces[p].StateValue);

            switch (piece.StateValue)
            {
            case 1:
                if (aliveNeighbors < 2 || aliveNeighbors > 3)
                {
                    return(Piece.Get(0));
                }
                else
                {
                    return(Piece.Get(1));
                }

            case 0:
                if (aliveNeighbors == 3 || aliveNeighbors == 6)
                {
                    return(Piece.Get(1));
                }
                else
                {
                    return(Piece.Get(0));
                }

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 6
0
        public Piece Run(PieceGrid currentGen, Point point, Piece piece)
        {
            int aliveNeighbors = PointHelpers.GetAdjacentPointsToroid(point, currentGen, PointHelpers.NeighborhoodOrder.Moore).Count(p => currentGen.PointPieces[p].StateValue > 0);

            switch (piece.StateValue)
            {
            case 1:
                if (SurvivalNeighborCounts.Contains(aliveNeighbors))
                {
                    return(Piece.Get(1));
                }
                else
                {
                    return(Piece.Get(0));
                }

            case 0:
                if (BirthNeighborCounts.Contains(aliveNeighbors))
                {
                    return(Piece.Get(1));
                }
                else
                {
                    return(Piece.Get(0));
                }

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 7
0
        public void EvaluationValuesLite()
        {
            PieceGrid grid          = GetPieceGrid();
            var       analysisGraph = new AnalysisGraphLite();

            analysisGraph.BuildAnalysis(grid, Owner.Player1);
            Assert.AreEqual("8.40", $"{analysisGraph.T1:0.00}");
        }
Ejemplo n.º 8
0
        public PieceGrid Run(PieceGrid currentGen)
        {
            PieceGrid nextGen = currentGen.Clone();

            foreach (var kvp in currentGen.PointPieces)
            {
            }
            return(nextGen);
        }
Ejemplo n.º 9
0
 public virtual void Initialize(int gridSize, IRuleChooser ruleChooser)
 {
     _random        = new Random();
     _allRules      = new List <ICARule>();
     _rulePoints    = new Dictionary <Point, ICARule>();
     _rulePointsAge = new Dictionary <Point, int>();
     _currentGen    = new PieceGrid(gridSize);
     _currentGen.Initialize();
     _ruleChooser = ruleChooser;
 }
Ejemplo n.º 10
0
 public virtual void Initialize()
 {
     _random        = new Random();
     _allRules      = new List <ICARule>();
     _rulePoints    = new Dictionary <Point, ICARule>();
     _rulePointsAge = new Dictionary <Point, int>();
     _currentGen    = new PieceGrid(100);
     _currentGen.Initialize();
     _ruleChooser = new MajorityInOrderRuleChooser();
 }
Ejemplo n.º 11
0
        public PieceGrid Run(PieceGrid currentGen)
        {
            PieceGrid nextGen = currentGen.Clone();

            foreach (var kvp in currentGen.PointPieces)
            {
                nextGen.PointPieces[kvp.Key] = Run(currentGen, kvp.Key, kvp.Value);
            }
            return(nextGen);
        }
Ejemplo n.º 12
0
        public void PointsOutFrom()
        {
            HashSet <Point> answer = new HashSet <Point>()
            {
                Point.Get(0, 4), Point.Get(0, 5), Point.Get(1, 4), Point.Get(2, 5), Point.Get(3, 6), Point.Get(4, 7), Point.Get(5, 8), Point.Get(1, 3), Point.Get(2, 3), Point.Get(3, 3), Point.Get(4, 3), Point.Get(5, 3), Point.Get(6, 3), Point.Get(7, 3), Point.Get(8, 3), Point.Get(0, 2), Point.Get(0, 1), Point.Get(0, 0), Point.Get(1, 2), Point.Get(2, 1),
            };
            PieceGrid           grid   = new PieceGrid(10, PieceHelpers.GetInitialAmazonPositions(10));
            IEnumerable <Point> points = grid.GetOpenPointsOutFrom(Point.Get(0, 3));

            Assert.IsTrue(points.ToSet().SetEquals(answer));
        }
Ejemplo n.º 13
0
        public void ArrowsOutFromPoint2()
        {
            HashSet <Point> answer = new HashSet <Point>()
            {
                Point.Get(3, 7), Point.Get(4, 6), Point.Get(1, 4), Point.Get(7, 4), Point.Get(2, 7), Point.Get(4, 9), Point.Get(6, 7)
            };
            PieceGrid           grid   = GetPieceGrid();
            IEnumerable <Point> points = grid.GetArrowsOutFrom(Point.Get(4, 7), Owner.Player2, true);

            Assert.IsTrue(points.ToSet().SetEquals(answer));
        }
Ejemplo n.º 14
0
        public void MovesFrom()
        {
            HashSet <Move> answer = new HashSet <Move>()
            {
                new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 0)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(1, 0)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(9, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(8, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(7, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(6, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(5, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(3, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(0, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(9, 8)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(8, 7)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(7, 6)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(6, 5)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 9)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 8)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 7)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 6)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(2, 1), Point.Get(1, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(2, 1)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 0)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(0, 1)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(9, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(8, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(7, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(6, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(5, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(4, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(0, 2)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(8, 9)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(7, 8)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(6, 7)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 9)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 8)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 7)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 6)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 5)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(1, 2), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(2, 0)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(1, 0)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(9, 9)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(8, 8)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(7, 7)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(6, 6)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(5, 5)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(4, 4)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(0, 5)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(0, 4)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(0, 2)), new Move(Point.Get(0, 3), Point.Get(0, 0), Point.Get(0, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(1, 0)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(0, 0)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(9, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(8, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(7, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(6, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(5, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(3, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(2, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(8, 9)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(7, 8)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(6, 7)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(1, 2)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(0, 5)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(0, 4)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(0, 1), Point.Get(0, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(2, 0)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(0, 0)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(0, 1)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(9, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(8, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(7, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(6, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(5, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(4, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(1, 2)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(7, 9)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(6, 8)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(5, 7)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(4, 6)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(3, 5)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(0, 5)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(0, 4)), new Move(Point.Get(0, 3), Point.Get(0, 2), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(9, 2)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 0)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 1)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 2)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(5, 0)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(6, 1)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(7, 2)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(7, 3)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(9, 4)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 9)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 8)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 7)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 6)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 5)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(8, 4)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(2, 9)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(3, 8)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(4, 7)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(6, 5)), new Move(Point.Get(0, 3), Point.Get(8, 3), Point.Get(7, 4)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(9, 1)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(8, 2)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 0)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 1)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 2)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(4, 0)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(5, 1)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(6, 2)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(9, 5)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(8, 4)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 9)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 8)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 7)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 6)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 5)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(7, 4)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(1, 9)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(2, 8)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(3, 7)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(4, 6)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(5, 5)), new Move(Point.Get(0, 3), Point.Get(7, 3), Point.Get(6, 4)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(9, 0)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(8, 1)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(7, 2)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 1)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 2)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(5, 2)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(7, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(8, 5)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(7, 4)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 8)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 7)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 6)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 5)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 4)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(0, 9)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(1, 8)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(2, 7)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(3, 6)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(8, 0)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(7, 1)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(6, 2)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 0)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 1)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 2)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(2, 0)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(3, 1)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(4, 2)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(7, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(9, 7)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(8, 6)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(7, 5)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(6, 4)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 9)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 8)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 7)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 5)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(0, 8)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(1, 7)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(2, 6)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(3, 5)), new Move(Point.Get(0, 3), Point.Get(5, 3), Point.Get(4, 4)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(7, 0)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(6, 1)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(5, 2)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 0)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 2)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(1, 0)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(2, 1)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(7, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(9, 8)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(8, 7)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(7, 6)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(6, 5)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 9)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 8)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 7)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 6)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(4, 4)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(0, 7)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(1, 6)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(4, 3), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(5, 1)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(4, 2)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(3, 1)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(0, 0)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(7, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(9, 9)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(8, 8)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(7, 7)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(6, 6)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(5, 5)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(4, 4)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(3, 8)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(3, 7)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(3, 6)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(3, 5)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(1, 5)), new Move(Point.Get(0, 3), Point.Get(3, 3), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(5, 0)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 0)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 1)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(0, 1)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(1, 2)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(7, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(8, 9)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(7, 8)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(6, 7)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 9)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 8)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 7)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 6)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(0, 5)), new Move(Point.Get(0, 3), Point.Get(2, 3), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(4, 0)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(3, 1)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 0)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 2)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(0, 2)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(7, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(7, 9)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(6, 8)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(5, 7)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(4, 6)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(3, 5)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 9)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 8)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 7)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 6)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 5)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(1, 3), Point.Get(0, 4)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(9, 4)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(8, 5)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(7, 6)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(6, 7)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 0)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 1)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 2)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 3)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 5)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 7)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(3, 6)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(4, 7)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(9, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(8, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(7, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(6, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(0, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(1, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(2, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(3, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(4, 8)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(5, 9)), new Move(Point.Get(0, 3), Point.Get(5, 8), Point.Get(4, 9)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(9, 2)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(8, 3)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(7, 4)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(6, 5)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 0)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 2)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 4)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 6)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(3, 6)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(9, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(8, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(7, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(6, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(5, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(0, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(1, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(2, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(3, 7)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(5, 8)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 9)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(4, 8)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(2, 9)), new Move(Point.Get(0, 3), Point.Get(4, 7), Point.Get(3, 8)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(9, 0)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(8, 1)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(7, 2)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(6, 3)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(3, 1)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(3, 3)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(3, 5)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(8, 6)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(7, 6)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(6, 6)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(5, 6)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(4, 6)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(1, 6)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(2, 6)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(5, 8)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(4, 7)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(3, 8)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(3, 7)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(0, 9)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(1, 8)), new Move(Point.Get(0, 3), Point.Get(3, 6), Point.Get(2, 7)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(7, 0)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(6, 1)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(5, 2)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(4, 3)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 0)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 1)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(9, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(8, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(7, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(6, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(5, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(3, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(0, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(1, 5)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(5, 8)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(4, 7)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(3, 6)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 9)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 8)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 7)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(2, 6)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(0, 7)), new Move(Point.Get(0, 3), Point.Get(2, 5), Point.Get(1, 6)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(5, 0)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 0)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 1)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 2)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(9, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(8, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(7, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(6, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(4, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(0, 4)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(5, 8)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(4, 7)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(3, 6)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 9)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 8)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 7)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 6)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(1, 5)), new Move(Point.Get(0, 3), Point.Get(1, 4), Point.Get(0, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(5, 0)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(4, 1)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(3, 2)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(2, 3)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(0, 0)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(0, 1)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(0, 2)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(0, 4)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(9, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(8, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(7, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(6, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(5, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(4, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(3, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(2, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(1, 5)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(4, 9)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(3, 8)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(2, 7)), new Move(Point.Get(0, 3), Point.Get(0, 5), Point.Get(1, 6)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(4, 0)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(3, 1)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(2, 2)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(1, 3)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(0, 0)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(0, 1)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(0, 2)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(0, 3)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(9, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(8, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(7, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(6, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(5, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(4, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(3, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(2, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(1, 4)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(5, 9)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(4, 8)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(3, 7)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(2, 6)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(1, 5)), new Move(Point.Get(0, 3), Point.Get(0, 4), Point.Get(0, 5)),
            };
            PieceGrid          grid  = new PieceGrid(10, PieceHelpers.GetInitialAmazonPositions(10));
            IEnumerable <Move> moves = grid.GetMovesFromPoint(Point.Get(0, 3));

            //string code = GetMoveString(moves);
            Assert.IsTrue(moves.ToSet().SetEquals(answer));
        }
Ejemplo n.º 15
0
        public void ReverseMovesFrom()
        {
            HashSet <Move> answer = new HashSet <Move>()
            {
                new Move(Point.Get(6, 0), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(5, 0), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(9, 1), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(8, 1), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(7, 1), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(4, 1), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(6, 5), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(6, 4), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(6, 3), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(6, 2), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(2, 5), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(3, 4), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(4, 3), Point.Get(6, 1), Point.Get(6, 4)), new Move(Point.Get(5, 2), Point.Get(6, 1), Point.Get(6, 4)),
            };
            PieceGrid          grid  = GetPieceGrid();
            IEnumerable <Move> moves = grid.GetReverseMovesFromPoint(Point.Get(6, 1), Owner.Player2);
            string             code  = GetMoveString(moves);

            Assert.IsFalse(moves.Any(m => m.Origin.Equals(Point.Get(5, 1))));
            Assert.IsTrue(moves.ToSet().SetEquals(answer));
        }
Ejemplo n.º 16
0
        public void PointsOutFromArrow()
        {
            HashSet <Point> answer = new HashSet <Point>()
            {
                Point.Get(5, 1), Point.Get(4, 2), Point.Get(3, 1), Point.Get(3, 2), Point.Get(0, 0), Point.Get(1, 1), Point.Get(2, 2), Point.Get(8, 3), Point.Get(7, 3), Point.Get(6, 3), Point.Get(5, 3), Point.Get(4, 3), Point.Get(0, 3), Point.Get(1, 3), Point.Get(2, 3), Point.Get(9, 9), Point.Get(8, 8), Point.Get(7, 7), Point.Get(6, 6), Point.Get(5, 5), Point.Get(4, 4), Point.Get(3, 8), Point.Get(3, 7), Point.Get(3, 6), Point.Get(3, 5), Point.Get(3, 4), Point.Get(1, 5), Point.Get(2, 4),
            };
            PieceGrid           grid   = new PieceGrid(10, PieceHelpers.GetInitialAmazonPositions(10));
            IEnumerable <Point> points = grid.GetOpenPointsOutFrom(Point.Get(3, 3), Point.Get(0, 3));

            Assert.IsTrue(points.Contains(Point.Get(0, 3)));
            //string code = GetPointsString(points);
            Assert.IsTrue(points.ToSet().SetEquals(answer));
        }
Ejemplo n.º 17
0
        public void PointsOutFrom2()
        {
            HashSet <Point> answer = new HashSet <Point>()
            {
                Point.Get(9, 0), Point.Get(8, 1), Point.Get(7, 2), Point.Get(6, 3), Point.Get(5, 0), Point.Get(5, 1), Point.Get(5, 2), Point.Get(5, 3), Point.Get(1, 0), Point.Get(2, 1), Point.Get(3, 2), Point.Get(4, 3), Point.Get(9, 4), Point.Get(8, 4), Point.Get(7, 4), Point.Get(6, 4), Point.Get(0, 4), Point.Get(1, 4), Point.Get(2, 4), Point.Get(3, 4), Point.Get(4, 4), Point.Get(9, 8), Point.Get(8, 7), Point.Get(7, 6), Point.Get(6, 5), Point.Get(5, 9), Point.Get(5, 8), Point.Get(5, 7), Point.Get(5, 6), Point.Get(5, 5), Point.Get(0, 9), Point.Get(1, 8), Point.Get(2, 7), Point.Get(3, 6), Point.Get(4, 5),
            };
            PieceGrid grid = new PieceGrid(10, PieceHelpers.GetInitialAmazonPositions(10));

            grid.PointPieces[Point.Get(0, 3)] = Open.Get();
            grid.PointPieces[Point.Get(5, 4)] = AmazonPlayer1.Get();
            IEnumerable <Point> points = grid.GetOpenPointsOutFrom(Point.Get(5, 4));

            Assert.IsTrue(points.ToSet().SetEquals(answer));
        }
Ejemplo n.º 18
0
        public void EvaluationValues()
        {
            PieceGrid grid          = GetPieceGrid();
            var       analysisGraph = new AnalysisGraph();

            analysisGraph.BuildAnalysis(grid, Owner.Player1);
            Assert.AreEqual("43.38", $"{analysisGraph.W:0.00}");
            Assert.AreEqual("8.40", $"{analysisGraph.T1:0.00}");
            Assert.AreEqual("-3.20", $"{analysisGraph.T2:0.00}");
            Assert.AreEqual("3.88", $"{analysisGraph.C1:0.00}");
            Assert.AreEqual("1.83", $"{analysisGraph.C2:0.00}");
            Assert.AreEqual("0.87", $"{analysisGraph.T:0.00}");
            Assert.AreEqual("17.51", $"{analysisGraph.M:0.00}");
            Assert.AreEqual("18.38", $"{analysisGraph.T + analysisGraph.M:0.00}");
        }
Ejemplo n.º 19
0
    public void UpdateGrid(PieceGrid pieceGrid, Vector2Int position)
    {
        // Add new children to grid
        foreach (Vector2 block in pieceGrid.blockPositions)
        {
            int vx = position.x + (int)(block.x);
            int vy = position.y + (int)(block.y);
            Debug.Log("Add New");
            Debug.Log(vx);
            Debug.Log(vy);
            grid[vx, vy + 1] = true;

            Debug.Log("after grid [" + vx + "," + vy + "] is : " + grid[vx, vy + 1]);
        }
    }
Ejemplo n.º 20
0
        public void PointsOutFromArrow2()
        {
            HashSet <Point> answer = new HashSet <Point>()
            {
                Point.Get(5, 0), Point.Get(4, 1), Point.Get(3, 1), Point.Get(1, 0), Point.Get(2, 1), Point.Get(9, 2), Point.Get(8, 2), Point.Get(7, 2), Point.Get(6, 2), Point.Get(5, 2), Point.Get(4, 2), Point.Get(0, 2), Point.Get(1, 2), Point.Get(2, 2), Point.Get(9, 8), Point.Get(8, 7), Point.Get(7, 6), Point.Get(6, 5), Point.Get(5, 4), Point.Get(4, 3), Point.Get(3, 8), Point.Get(3, 7), Point.Get(3, 6), Point.Get(3, 5), Point.Get(3, 4), Point.Get(3, 3), Point.Get(0, 5), Point.Get(1, 4), Point.Get(2, 3),
            };
            PieceGrid grid = new PieceGrid(10, PieceHelpers.GetInitialAmazonPositions(10));

            grid.PointPieces[Point.Get(0, 3)] = Open.Get();
            grid.PointPieces[Point.Get(5, 4)] = AmazonPlayer1.Get();
            IEnumerable <Point> points = grid.GetOpenPointsOutFrom(Point.Get(3, 2), Point.Get(5, 4));

            //string code = GetPointsString(points);
            Assert.IsTrue(points.ToSet().SetEquals(answer));
        }
Ejemplo n.º 21
0
        private PieceGrid GetPieceGrid()
        {
            Point[] arrowPoints = { Point.Get(2, 9), Point.Get(4, 9), Point.Get(3, 8), Point.Get(4, 8), Point.Get(2, 7), Point.Get(3, 7), Point.Get(5, 7), Point.Get(6, 7), Point.Get(7, 7), Point.Get(8, 7), Point.Get(1, 6), Point.Get(2, 6), Point.Get(4, 6), Point.Get(8, 6), Point.Get(0, 5), Point.Get(5, 5), Point.Get(1, 4), Point.Get(2, 4), Point.Get(5, 4), Point.Get(6, 4), Point.Get(7, 4), Point.Get(7, 3), Point.Get(1, 2), Point.Get(9, 2), Point.Get(0, 0), Point.Get(7, 0), };
            Dictionary <Point, Amazon> amazonsDict = new Dictionary <Point, Amazon> {
                { Point.Get(2, 8), AmazonPlayer1.Get() }, { Point.Get(6, 6), AmazonPlayer1.Get() }, { Point.Get(3, 3), AmazonPlayer1.Get() }, { Point.Get(7, 2), AmazonPlayer1.Get() },
                { Point.Get(3, 9), AmazonPlayer2.Get() }, { Point.Get(4, 7), AmazonPlayer2.Get() }, { Point.Get(3, 1), AmazonPlayer2.Get() }, { Point.Get(6, 1), AmazonPlayer2.Get() }
            };
            PieceGrid grid = new PieceGrid(10, amazonsDict);

            foreach (Point p in arrowPoints)
            {
                grid.PointPieces[p] = ArrowPlayer1.Get();
            }
            return(grid);
        }
Ejemplo n.º 22
0
        public void PointsOutFrom3()
        {
            HashSet <Point> answer = new HashSet <Point>()
            {
            };
            PieceGrid grid = new PieceGrid(10, PieceHelpers.GetInitialAmazonPositions(10));

            grid.PointPieces[Point.Get(0, 4)] = ArrowPlayer1.Get();
            grid.PointPieces[Point.Get(1, 4)] = ArrowPlayer1.Get();
            grid.PointPieces[Point.Get(1, 3)] = ArrowPlayer1.Get();
            grid.PointPieces[Point.Get(1, 2)] = ArrowPlayer1.Get();
            grid.PointPieces[Point.Get(0, 2)] = ArrowPlayer1.Get();
            IEnumerable <Point> points = grid.GetOpenPointsOutFrom(Point.Get(0, 3));

            Assert.IsTrue(points.ToSet().SetEquals(answer));
        }
Ejemplo n.º 23
0
        public void ApplyReverseMove()
        {
            PieceGrid grid = GetPieceGrid();

            Assert.AreEqual(AmazonPlayer2.Get(), grid.PointPieces[Point.Get(6, 1)]);
            Assert.AreEqual(ArrowPlayer2.Get(), grid.PointPieces[Point.Get(6, 4)]);
            Assert.AreEqual(Open.Get(), grid.PointPieces[Point.Get(5, 0)]);
            Assert.IsTrue(grid.Amazon2Points.Contains(Point.Get(6, 1)));
            Assert.IsFalse(grid.Amazon2Points.Contains(Point.Get(5, 0)));
            grid.ApplyReverseMove(new Move(Point.Get(5, 0), Point.Get(6, 1), Point.Get(6, 4)));
            Assert.AreEqual(Open.Get(), grid.PointPieces[Point.Get(6, 1)]);
            Assert.AreEqual(AmazonPlayer2.Get(), grid.PointPieces[Point.Get(5, 0)]);
            Assert.AreEqual(Open.Get(), grid.PointPieces[Point.Get(6, 4)]);
            Assert.IsTrue(grid.Amazon2Points.Contains(Point.Get(5, 0)));
            Assert.IsFalse(grid.Amazon2Points.Contains(Point.Get(6, 1)));
        }
Ejemplo n.º 24
0
        public void ApplyMove()
        {
            PieceGrid grid = new PieceGrid(10, PieceHelpers.GetInitialAmazonPositions(10));

            Assert.AreEqual(AmazonPlayer1.Get(), grid.PointPieces[Point.Get(0, 3)]);
            Assert.AreEqual(Open.Get(), grid.PointPieces[Point.Get(6, 3)]);
            Assert.AreEqual(Open.Get(), grid.PointPieces[Point.Get(6, 7)]);
            Assert.IsTrue(grid.Amazon1Points.Contains(Point.Get(0, 3)));
            Assert.IsFalse(grid.Amazon1Points.Contains(Point.Get(6, 3)));
            grid.ApplyMove(new Move(Point.Get(0, 3), Point.Get(6, 3), Point.Get(6, 7)));
            Assert.AreEqual(Open.Get(), grid.PointPieces[Point.Get(0, 3)]);
            Assert.AreEqual(AmazonPlayer1.Get(), grid.PointPieces[Point.Get(6, 3)]);
            Assert.AreEqual(ArrowPlayer1.Get(), grid.PointPieces[Point.Get(6, 7)]);
            Assert.IsTrue(grid.Amazon1Points.Contains(Point.Get(6, 3)));
            Assert.IsFalse(grid.Amazon1Points.Contains(Point.Get(0, 3)));
        }
Ejemplo n.º 25
0
 public bool IsInsideGrid(PieceGrid pieceGrid, Vector2Int position)
 {
     foreach (Vector2 block in pieceGrid.blockPositions)
     {
         Debug.Log(position);
         Debug.Log("isInsideGrid function, block : " + block);
         Debug.Log(position.y + (int)block.y);
         Debug.Log(" < 0 ");
         if (position.x + (int)block.x >= gridWidth || position.x + (int)block.x < 0 ||
             position.y + (int)block.y < 0)
         {
             Debug.Log("Is not inside grid");
             Debug.Log(position.y + (int)block.y <= 0);
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 26
0
        public void Distances()
        {
            Dictionary <Point, double> player1QueenDistancesAnswer = new Dictionary <Point, double> {
                { Point.Get(0, 1), 2 }, { Point.Get(0, 2), 2 }, { Point.Get(0, 3), 1 }, { Point.Get(0, 4), 2 }, { Point.Get(0, 6), 1 }, { Point.Get(0, 7), 2 }, { Point.Get(0, 8), 1 }, { Point.Get(0, 9), 2 }, { Point.Get(1, 0), 2 }, { Point.Get(1, 1), 1 }, { Point.Get(1, 3), 1 }, { Point.Get(1, 5), 2 }, { Point.Get(1, 7), 1 }, { Point.Get(1, 8), 1 }, { Point.Get(1, 9), 1 }, { Point.Get(2, 0), 2 }, { Point.Get(2, 1), 2 }, { Point.Get(2, 2), 1 }, { Point.Get(2, 3), 1 }, { Point.Get(2, 5), 2 }, { Point.Get(3, 0), 2 }, { Point.Get(3, 2), 1 }, { Point.Get(3, 4), 1 }, { Point.Get(3, 5), 1 }, { Point.Get(3, 6), 1 }, { Point.Get(4, 0), 2 }, { Point.Get(4, 1), 2 }, { Point.Get(4, 2), 1 }, { Point.Get(4, 3), 1 }, { Point.Get(4, 4), 1 }, { Point.Get(4, 5), 2 }, { Point.Get(5, 0), 2 }, { Point.Get(5, 1), 1 }, { Point.Get(5, 2), 1 }, { Point.Get(5, 3), 1 }, { Point.Get(5, 6), 1 }, { Point.Get(5, 8), 3 }, { Point.Get(5, 9), 3 }, { Point.Get(6, 0), 1 }, { Point.Get(6, 2), 1 }, { Point.Get(6, 3), 1 }, { Point.Get(6, 5), 1 }, { Point.Get(6, 8), 3 }, { Point.Get(6, 9), 3 }, { Point.Get(7, 1), 1 }, { Point.Get(7, 5), 1 }, { Point.Get(7, 6), 1 }, { Point.Get(7, 8), 3 }, { Point.Get(7, 9), 3 }, { Point.Get(8, 0), 2 }, { Point.Get(8, 1), 1 }, { Point.Get(8, 2), 1 }, { Point.Get(8, 3), 1 }, { Point.Get(8, 4), 1 }, { Point.Get(8, 5), 2 }, { Point.Get(8, 8), 3 }, { Point.Get(8, 9), 3 }, { Point.Get(9, 0), 1 }, { Point.Get(9, 1), 2 }, { Point.Get(9, 3), 1 }, { Point.Get(9, 4), 1 }, { Point.Get(9, 5), 2 }, { Point.Get(9, 6), 2 }, { Point.Get(9, 7), 2 }, { Point.Get(9, 8), 2 }, { Point.Get(9, 9), 2 },
            };
            Dictionary <Point, double> player2QueenDistancesAnswer = new Dictionary <Point, double> {
                { Point.Get(0, 1), 1 }, { Point.Get(0, 2), 2 }, { Point.Get(0, 3), 2 }, { Point.Get(0, 4), 1 }, { Point.Get(0, 6), 3 }, { Point.Get(0, 7), 4 }, { Point.Get(0, 8), 4 }, { Point.Get(0, 9), 4 }, { Point.Get(1, 0), 2 }, { Point.Get(1, 1), 1 }, { Point.Get(1, 3), 1 }, { Point.Get(1, 5), 2 }, { Point.Get(1, 7), 4 }, { Point.Get(1, 8), 5 }, { Point.Get(1, 9), 5 }, { Point.Get(2, 0), 1 }, { Point.Get(2, 1), 1 }, { Point.Get(2, 2), 1 }, { Point.Get(2, 3), 2 }, { Point.Get(2, 5), 1 }, { Point.Get(3, 0), 1 }, { Point.Get(3, 2), 1 }, { Point.Get(3, 4), 1 }, { Point.Get(3, 5), 2 }, { Point.Get(3, 6), 1 }, { Point.Get(4, 0), 1 }, { Point.Get(4, 1), 1 }, { Point.Get(4, 2), 1 }, { Point.Get(4, 3), 1 }, { Point.Get(4, 4), 2 }, { Point.Get(4, 5), 2 }, { Point.Get(5, 0), 1 }, { Point.Get(5, 1), 1 }, { Point.Get(5, 2), 1 }, { Point.Get(5, 3), 1 }, { Point.Get(5, 6), 1 }, { Point.Get(5, 8), 1 }, { Point.Get(5, 9), 2 }, { Point.Get(6, 0), 1 }, { Point.Get(6, 2), 1 }, { Point.Get(6, 3), 1 }, { Point.Get(6, 5), 1 }, { Point.Get(6, 8), 2 }, { Point.Get(6, 9), 1 }, { Point.Get(7, 1), 1 }, { Point.Get(7, 5), 2 }, { Point.Get(7, 6), 2 }, { Point.Get(7, 8), 2 }, { Point.Get(7, 9), 2 }, { Point.Get(8, 0), 2 }, { Point.Get(8, 1), 1 }, { Point.Get(8, 2), 2 }, { Point.Get(8, 3), 2 }, { Point.Get(8, 4), 2 }, { Point.Get(8, 5), 2 }, { Point.Get(8, 8), 2 }, { Point.Get(8, 9), 2 }, { Point.Get(9, 0), 2 }, { Point.Get(9, 1), 1 }, { Point.Get(9, 3), 2 }, { Point.Get(9, 4), 3 }, { Point.Get(9, 5), 2 }, { Point.Get(9, 6), 3 }, { Point.Get(9, 7), 3 }, { Point.Get(9, 8), 2 }, { Point.Get(9, 9), 2 },
            };
            Dictionary <Point, double> player1KingDistancesAnswer = new Dictionary <Point, double> {
                { Point.Get(0, 1), 3 }, { Point.Get(0, 2), 3 }, { Point.Get(0, 3), 3 }, { Point.Get(0, 4), 3 }, { Point.Get(0, 6), 2 }, { Point.Get(0, 7), 2 }, { Point.Get(0, 8), 2 }, { Point.Get(0, 9), 2 }, { Point.Get(1, 0), 3 }, { Point.Get(1, 1), 2 }, { Point.Get(1, 3), 2 }, { Point.Get(1, 5), 3 }, { Point.Get(1, 7), 1 }, { Point.Get(1, 8), 1 }, { Point.Get(1, 9), 1 }, { Point.Get(2, 0), 3 }, { Point.Get(2, 1), 2 }, { Point.Get(2, 2), 1 }, { Point.Get(2, 3), 1 }, { Point.Get(2, 5), 2 }, { Point.Get(3, 0), 3 }, { Point.Get(3, 2), 1 }, { Point.Get(3, 4), 1 }, { Point.Get(3, 5), 2 }, { Point.Get(3, 6), 3 }, { Point.Get(4, 0), 3 }, { Point.Get(4, 1), 2 }, { Point.Get(4, 2), 1 }, { Point.Get(4, 3), 1 }, { Point.Get(4, 4), 1 }, { Point.Get(4, 5), 2 }, { Point.Get(5, 0), 3 }, { Point.Get(5, 1), 2 }, { Point.Get(5, 2), 2 }, { Point.Get(5, 3), 2 }, { Point.Get(5, 6), 1 }, { Point.Get(5, 8), 8 }, { Point.Get(5, 9), 8 }, { Point.Get(6, 0), 2 }, { Point.Get(6, 2), 1 }, { Point.Get(6, 3), 1 }, { Point.Get(6, 5), 1 }, { Point.Get(6, 8), 7 }, { Point.Get(6, 9), 7 }, { Point.Get(7, 1), 1 }, { Point.Get(7, 5), 1 }, { Point.Get(7, 6), 1 }, { Point.Get(7, 8), 6 }, { Point.Get(7, 9), 6 }, { Point.Get(8, 0), 2 }, { Point.Get(8, 1), 1 }, { Point.Get(8, 2), 1 }, { Point.Get(8, 3), 1 }, { Point.Get(8, 4), 2 }, { Point.Get(8, 5), 2 }, { Point.Get(8, 8), 5 }, { Point.Get(8, 9), 6 }, { Point.Get(9, 0), 2 }, { Point.Get(9, 1), 2 }, { Point.Get(9, 3), 2 }, { Point.Get(9, 4), 2 }, { Point.Get(9, 5), 3 }, { Point.Get(9, 6), 3 }, { Point.Get(9, 7), 4 }, { Point.Get(9, 8), 5 }, { Point.Get(9, 9), 6 },
            };
            Dictionary <Point, double> player2KingDistancesAnswer = new Dictionary <Point, double> {
                { Point.Get(0, 1), 3 }, { Point.Get(0, 2), 3 }, { Point.Get(0, 3), 3 }, { Point.Get(0, 4), 3 }, { Point.Get(0, 6), 4 }, { Point.Get(0, 7), 5 }, { Point.Get(0, 8), 6 }, { Point.Get(0, 9), 7 }, { Point.Get(1, 0), 2 }, { Point.Get(1, 1), 2 }, { Point.Get(1, 3), 2 }, { Point.Get(1, 5), 3 }, { Point.Get(1, 7), 5 }, { Point.Get(1, 8), 6 }, { Point.Get(1, 9), 7 }, { Point.Get(2, 0), 1 }, { Point.Get(2, 1), 1 }, { Point.Get(2, 2), 1 }, { Point.Get(2, 3), 2 }, { Point.Get(2, 5), 2 }, { Point.Get(3, 0), 1 }, { Point.Get(3, 2), 1 }, { Point.Get(3, 4), 3 }, { Point.Get(3, 5), 2 }, { Point.Get(3, 6), 1 }, { Point.Get(4, 0), 1 }, { Point.Get(4, 1), 1 }, { Point.Get(4, 2), 1 }, { Point.Get(4, 3), 2 }, { Point.Get(4, 4), 3 }, { Point.Get(4, 5), 2 }, { Point.Get(5, 0), 1 }, { Point.Get(5, 1), 1 }, { Point.Get(5, 2), 1 }, { Point.Get(5, 3), 2 }, { Point.Get(5, 6), 1 }, { Point.Get(5, 8), 1 }, { Point.Get(5, 9), 2 }, { Point.Get(6, 0), 1 }, { Point.Get(6, 2), 1 }, { Point.Get(6, 3), 2 }, { Point.Get(6, 5), 2 }, { Point.Get(6, 8), 2 }, { Point.Get(6, 9), 2 }, { Point.Get(7, 1), 1 }, { Point.Get(7, 5), 3 }, { Point.Get(7, 6), 3 }, { Point.Get(7, 8), 3 }, { Point.Get(7, 9), 3 }, { Point.Get(8, 0), 2 }, { Point.Get(8, 1), 2 }, { Point.Get(8, 2), 2 }, { Point.Get(8, 3), 3 }, { Point.Get(8, 4), 4 }, { Point.Get(8, 5), 4 }, { Point.Get(8, 8), 4 }, { Point.Get(8, 9), 4 }, { Point.Get(9, 0), 3 }, { Point.Get(9, 1), 3 }, { Point.Get(9, 3), 3 }, { Point.Get(9, 4), 4 }, { Point.Get(9, 5), 5 }, { Point.Get(9, 6), 5 }, { Point.Get(9, 7), 5 }, { Point.Get(9, 8), 5 }, { Point.Get(9, 9), 5 },
            };

            ;
            PieceGrid grid = GetPieceGrid();

            var analysisGraph = new AnalysisGraph();

            analysisGraph.BuildAnalysis(grid, Owner.Player1);

            foreach (var kvp in player1QueenDistancesAnswer)
            {
                Assert.IsTrue(analysisGraph.Player1QueenMinDistances.ContainsKey(kvp.Key));
                Assert.AreEqual(kvp.Value, analysisGraph.Player1QueenMinDistances[kvp.Key]);
            }
            foreach (var kvp in player2QueenDistancesAnswer)
            {
                Assert.IsTrue(analysisGraph.Player2QueenMinDistances.ContainsKey(kvp.Key));
                Assert.AreEqual(kvp.Value, analysisGraph.Player2QueenMinDistances[kvp.Key]);
            }
            foreach (var kvp in player1KingDistancesAnswer)
            {
                Assert.IsTrue(analysisGraph.Player1KingMinDistances.ContainsKey(kvp.Key));
                Assert.AreEqual(kvp.Value, analysisGraph.Player1KingMinDistances[kvp.Key]);
            }
            foreach (var kvp in player2KingDistancesAnswer)
            {
                Assert.IsTrue(analysisGraph.Player2KingMinDistances.ContainsKey(kvp.Key));
                Assert.AreEqual(kvp.Value, analysisGraph.Player2KingMinDistances[kvp.Key]);
            }
        }
Ejemplo n.º 27
0
        public PieceGrid Run(PieceGrid currentGen)
        {
            tweakPoints1.Clear();
            tweakPoints2.Clear();
            PieceGrid nextGen = currentGen.Clone();

            foreach (var kvp in currentGen.PointPieces)
            {
                nextGen.PointPieces[kvp.Key] = Run(currentGen, kvp.Key, kvp.Value);
            }

            // add live player cells on the board trying to increase at the center
            Point goalPoint = new Point(50, 50);

            if (tweakPoints1.Any() && _xtraCount1 > 0)
            {
                foreach (Point p in tweakPoints1.OrderBy(p => p.Distance(goalPoint)))
                {
                    int aliveNeighbors = PointHelpers.GetAdjacentPointsToroid(p, nextGen, PointHelpers.NeighborhoodOrder.Moore).Sum(n => nextGen.PointPieces[n].StateValue);
                    if (aliveNeighbors == 2)
                    {
                        nextGen.PointPieces[p] = Piece.Get(1, Owner.Player1, PieceAspect.Played);
                        _xtraCount1--;
                        break;
                    }
                }
            }

            if (tweakPoints2.Any() && _xtraCount2 > 0)
            {
                foreach (Point p in tweakPoints2.OrderBy(p => p.Distance(goalPoint)))
                {
                    int aliveNeighbors = PointHelpers.GetAdjacentPointsToroid(p, nextGen, PointHelpers.NeighborhoodOrder.Moore).Sum(n => nextGen.PointPieces[n].StateValue);
                    if (aliveNeighbors == 2)
                    {
                        nextGen.PointPieces[p] = Piece.Get(1, Owner.Player2, PieceAspect.Played);
                        _xtraCount2--;
                        break;
                    }
                }
            }
            return(nextGen);
        }
Ejemplo n.º 28
0
        public virtual void ExecuteGameLoop()
        {
            PieceGrid nextGen = _currentGen.Clone();
            Dictionary <Point, ICARule> nextRulePoints = new Dictionary <Point, ICARule>();

            foreach (var kvp in _currentGen.PointPieces)
            {
                bool         existingRule   = _rulePoints.TryGetValue(kvp.Key, out ICARule rule);
                List <Point> nPoints        = PointHelpers.GetAdjacentPointsToroid(kvp.Key, _currentGen, PointHelpers.NeighborhoodOrder.Moore).ToList();
                bool         aliveNeighbors = nPoints.Any(p => _currentGen.PointPieces[p].StateValue > 0);
                if (!existingRule && !aliveNeighbors)
                {
                    continue;
                }

                if (!existingRule)
                {
                    rule = _ruleChooser.Choose(_random, this, nPoints);
                    nextRulePoints.Add(kvp.Key, rule);
                    _rulePointsAge[kvp.Key] = 1;
                }
                else if (!aliveNeighbors)
                {
                    _rulePointsAge[kvp.Key] = 0;
                }
                else
                {
                    nextRulePoints.Add(kvp.Key, rule);
                    if (_rulePointsAge.ContainsKey(kvp.Key))
                    {
                        _rulePointsAge[kvp.Key]++;
                    }
                    else
                    {
                        _rulePointsAge[kvp.Key] = 1;
                    }
                }
                nextGen.PointPieces[kvp.Key] = rule.Run(_currentGen, kvp.Key);
            }

            _rulePoints = nextRulePoints;
            _currentGen = nextGen;
        }
Ejemplo n.º 29
0
    public bool IsValidPosition(PieceGrid pieceGrid, Vector2Int position)
    {
        if (!IsInsideGrid(pieceGrid, position))
        {
            return(false);
        }

        foreach (Vector2 block in pieceGrid.blockPositions)
        {
            int vx = position.x + (int)(block.x);
            int vy = position.y + (int)(block.y);
            Debug.Log("Is inside grid and grid is" + grid[vx, vy]);
            if (grid[vx, vy] == true)
            {
                return(false);
            }
        }
        return(true);
    }
Ejemplo n.º 30
0
 bool CanPlace(Piece pieceData, PieceGrid solution, int i, int j)
 {
     if (i > 0 && solution[i - 1][j] != null && solution[i - 1][j].Bottom != pieceData.Top)
     {
         return(false);
     }
     if (i < PuzzleSize - 1 && solution[i + 1][j] != null && solution[i + 1][j].Top != pieceData.Bottom)
     {
         return(false);
     }
     if (j > 0 && solution[i][j - 1] != null && solution[i][j - 1].Right != pieceData.Left)
     {
         return(false);
     }
     if (j < PuzzleSize - 1 && solution[i][j + 1] != null && solution[i][j + 1].Left != pieceData.Right)
     {
         return(false);
     }
     return(true);
 }