SetupMove() public method

Adds a stone to the board as a setup move.
public SetupMove ( Point p, Content c ) : void
p Point The coordinates of the setup move.
c Content The color of the stone to add (or empty to clear).
return void
Example #1
0
 public void SerializeToSGFTest1()
 {
     GameInfo gi = new GameInfo();
     gi.BoardSizeX = gi.BoardSizeY = 9;
     gi.FreePlacedHandicap = false;
     gi.Handicap = 3;
     gi.Komi = 7.5;
     gi.StartingPlayer = Content.White;
     Game target = new Game(gi);
     target.SetupMove(5, 5, Content.Black);
     target.SetupMove(6, 5, Content.Black);
     target.SetupMove(8, 5, Content.White);
     target.MakeMove(5, 7).MakeMove(6, 7);
     target.MakeMove(5, 8);
     string expected = @"(;AB[cc][gg][gc][ff][gf]AW[if]HA[3]PL[W]KM[7.50]SZ[9](;W[fh];B[gh])(;W[fi]))";
     string actual;
     actual = target.SerializeToSGF(null);
     Assert.AreEqual(expected, actual);
 }
Example #2
0
        static void Main(string[] args)
        {
            var gi = new GameInfo();
            var g = new Game(gi);
            g.SetupMove(1, 3, Content.Black);
            g.SetupMove(1, 4, Content.Black);
            g.SetupMove(2, 2, Content.Black);
            g.SetupMove(2, 5, Content.Black);
            g.SetupMove(3, 3, Content.Black);
            g.SetupMove(3, 1, Content.Black);
            g.SetupMove(4, 1, Content.Black);
            g.SetupMove(5, 2, Content.Black);

            g.SetupMove(2, 3, Content.White);
            g.SetupMove(2, 4, Content.White);
            g.SetupMove(3, 2, Content.White);
            g.SetupMove(3, 4, Content.White);
            g.SetupMove(3, 5, Content.White);
            g.SetupMove(4, 2, Content.White);
            g.SetupMove(4, 4, Content.White);
            g.SetupMove(5, 3, Content.White);

            Console.WriteLine("{0}", g.Board);
            var result = g.MakeMove(4, 3);
            Console.WriteLine("{0}", result.Board);
        }