Example #1
0
 public int SubmitMove(object[] Move)
 {
     if (InternalSimulator)
     {
         return(Sim.ReturnChosenCommand());
     }
     else
     {
         return((int)CC.InvokeDictionaryMethod(6, new object[0]));
     }
 }
Example #2
0
 private void UL_Click(object sender, EventArgs e)
 {
     if (!TicTacToeSim.Finished())
     {
         if (UL.Text == "")
         {
             object[] Decision = new object[1];
             Decision[0] = new object[1];
             ((object[])Decision[0])[0] = 0;
             TicTacToeSim.SetCommand(Decision);
             if (turn == 1)
             {
                 if (TicTacToeSim.ReturnChosenCommand() == 0)
                 {
                     UL.Text = "O";
                     LogHumanMove(new CommandCArgs(new int[] { TicTacToeSim.ReturnChosenCommand(), 1 }));
                     turn--;
                 }
             }
             else
             {
                 if (TicTacToeSim.ReturnChosenCommand() == 0)
                 {
                     UL.Text = "X";
                     LogHumanMove(new CommandCArgs(new int[] { TicTacToeSim.ReturnChosenCommand(), 1 }));
                     turn++;
                 }
             }
             if (TicTacToeSim.Finished())
             {
                 PrintResults(TicTacToeSim.GetUnweightedResult(1));
             }
             else if (PlayerMode == 1)
             {
                 AiMove();
             }
         }
     }
 }