示例#1
0
 public static IBoard Create(Player turn, int[] configuration)
 {
     IBoard retVal = new Board()
                         {
                             Turn = turn
                         };
     for (int i = 0; i < configuration.Count(); i++)
     {
         retVal.Cups.ToArray()[i].Seeds = configuration[i];
     }
     return retVal;
 }
示例#2
0
文件: Test.cs 项目: jasmarc/mancala
 public void TestCrossCup()
 {
     Board b = new Board();
     ICup[] cups = b.Cups.ToArray();
     Assert.AreEqual(cups[12], b.CrossCup(cups[0]));
     Assert.AreEqual(cups[11], b.CrossCup(cups[1]));
     Assert.AreEqual(cups[10], b.CrossCup(cups[2]));
     Assert.AreEqual(cups[9],  b.CrossCup(cups[3]));
     Assert.AreEqual(cups[8],  b.CrossCup(cups[4]));
     Assert.AreEqual(cups[7],  b.CrossCup(cups[5]));
     Assert.AreEqual(cups[5],  b.CrossCup(cups[7]));
     Assert.AreEqual(cups[4],  b.CrossCup(cups[8]));
     Assert.AreEqual(cups[3],  b.CrossCup(cups[9]));
     Assert.AreEqual(cups[2],  b.CrossCup(cups[10]));
     Assert.AreEqual(cups[1],  b.CrossCup(cups[11]));
     Assert.AreEqual(cups[0],  b.CrossCup(cups[12]));
 }
示例#3
0
 public static IBoard Copy(IBoard b)
 {
     IBoard retVal = new Board();
     Set(retVal, b);
     return retVal;
 }