Example #1
0
        public void TestSuicideIsIllegal()
        {
            GoBoard lGoBoard = new GoBoard(19);

            lGoBoard.PlayStone("B1", Color.Black, true);
            lGoBoard.PlayStone("A2", Color.Black, true);

            Assert.IsTrue(lGoBoard.IsSuicide(lGoBoard.Coord.At("A1"), Color.White), lGoBoard.ToString());
        }
        public void TestSuicideIsIllegal()
        {
            GoBoard lGoBoard = new GoBoard(19);

            lGoBoard.PlayStone("B1", Color.Black, true);
            lGoBoard.PlayStone("A2", Color.Black, true);

            Assert.IsTrue(lGoBoard.IsSuicide(lGoBoard.Coord.At("A1"), Color.White), lGoBoard.ToString());
        }
        public static int LibertyCountAfterMove(GoBoard goBoard, Color player, int move)
        {
            if (!goBoard.GetColor(move).IsEmpty)
            {
                return(0);                  // invalid
            }
            if (goBoard.IsSuicide(move, player))
            {
                return(0);
            }

            goBoard.PlayStone(move, player, true);

            int lLiberities = goBoard.GetBlockLibertyCount(move);

            goBoard.Undo();

            return(lLiberities);
        }
 public static int IsSuicideXMove(GoBoard goBoard, Color player, PatternFunctionParameters <int> parameters)
 {
     return(goBoard.IsSuicide(parameters[0], player.Opposite) ? TRUE : FALSE);
 }
Example #5
0
        public static int LibertyCountAfterMove(GoBoard goBoard, Color player, int move)
        {
            if (!goBoard.GetColor(move).IsEmpty)
                return 0;   // invalid

            if (goBoard.IsSuicide(move, player))
                return 0;

            goBoard.PlayStone(move, player, true);

            int lLiberities = goBoard.GetBlockLibertyCount(move);

            goBoard.Undo();

            return lLiberities;
        }
Example #6
0
 public static int IsSuicideXMove(GoBoard goBoard, Color player, PatternFunctionParameters<int> parameters)
 {
     return goBoard.IsSuicide(parameters[0], player.Opposite) ? TRUE : FALSE;
 }