public void Play() { while (true) { Console.Clear(); board.DrawBoard(); if (board.CheckForDraw) { Console.WriteLine("It's a draw!"); break; } if (board.CheckForWin(Board.Opposite(board.CurrentPlayer))) { Console.WriteLine("Player {0} wins!", Board.Opposite(board.CurrentPlayer)); break; } Console.WriteLine(board.CurrentPlayer + "'s turn"); board.AddPiece(CurrentPlayer.GetMove(board)); } }
private void pic_board_Paint(object sender, PaintEventArgs e) { //gets called whenever the screen is painted board.DrawBoard(e.Graphics); }