public void ApplyMove(Move move, bool player)
        {
            if (move.GetMoveI() == -1 && move.GetMoveJ() == -1)
            {
                board = Transpose().board;
            }
            int newHex = player ? 1 : 2;

            board[move.GetMoveI(), move.GetMoveJ()] = newHex;
        }
Beispiel #2
0
        public void send(Move M)
        {
            byte[] ack = new byte[1024];


            String data = M.GetMoveI().ToString();

            data = data + ",";
            data = data + M.GetMoveJ().ToString();
            int bytesSent = S.Send(Encoding.ASCII.GetBytes(data + "<EOF>"));

            StreamWriter file = new StreamWriter("log.txt", true);

            file.WriteLine(DateTime.Now.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo) + "(" + M.GetMoveI() + "," + M.GetMoveJ() + ")" + " received");
            file.Close();
            int bytesRec = S.Receive(ack);
        }