Ejemplo n.º 1
0
        private double EvalQuintuplet(Quintuplet quin, Game.Mark mark, BoardState boardState)
        {
            int[] evaluationKeyHis = { 1, 2, 10, 200, 10000 };
            int[] evaluationKeyMy  = { 1, 4, 50, 1000, 585858 };
            int   myMarks          = 0;
            int   hisMarks         = 0;

            for (int i = 0; i < 5; i++)
            {
                if (boardState[quin.Cells[i]] == mark)
                {
                    myMarks++;
                }
                else if (boardState[quin.Cells[i]] != Game.Mark.None)
                {
                    hisMarks++;
                }
            }

            if (myMarks != 0 && hisMarks != 0)
            {
                return(0);
            }
            else if (myMarks == 0)
            {
                return(DeffensiveQ * (double)evaluationKeyHis[hisMarks]);
            }
            return(evaluationKeyMy[myMarks]);
        }
Ejemplo n.º 2
0
        private List <Quintuplet> GetCellQuintuplets(Cell cell)
        {
            List <Quintuplet> cellQuins = new List <Quintuplet>();

            for (int direction = 0; direction < 4; direction++)
            {
                for (int shift = -4; shift <= 0; shift++)
                {
                    Quintuplet quintuplet = new Quintuplet(cell, new Direction(direction), shift);
                    if (quintuplet.Validate(BoardState.Size))
                    {
                        cellQuins.Add(quintuplet);
                    }
                }
            }
            return(cellQuins);
        }