import java.util.*;

public class TicTacToe {
  // Variables ----------------------------------------------------------------
  private int rows, cols;
  private String[][] board = new String[rows][cols];
  private boolean game = false;
  private boolean aiWin = false;
  private boolean playerWin = false;
 
  public TicTacToe(){ // when called it starts a new game
    game = true;
  }  
  public int countEmpt(){ // counts the empty spaces left on the board
    int spaces = 0;
    for(int x = 0; x < board.length; x++){ //rows
        for(int y = 0; y < board[0].length; y ++){ //collums
          if(board[x][y].equals("")){
           spaces ++; 
          }
    }}
  }
   public boolean vCheck() {  // checks the board Vertically(row) for a win
	  for(int c = 0; c < board[0].length; c++)
	  {
		  if(board[0][c].equals("X") && board[1][c].equals("X") && board[2][c].equals("X"))
		  {
			  aiWin = true;
			  return true;
		  }
		  else if(board[0][c].equals("O") && board[1][c].equals("O") && board[2][c].equals("O"))
		  {
			  playerWin = true; 
			  return true;
		  }
			  
	  }
 
	  return false;
}
  public boolean hCheck(){ // checks the board Horizontally(column) for a win
    
	  for(int r = 0; r < board.length; r++)
	  {
		  if(board[r][0].equals("X") && board[r][1].equals("X") && board[r][2].equals("X"))
		  {
			  aiWin = true;
			  return true;
		  }
		  else if(board[r][0].equals("O") && board[r][1].equals("O") && board[r][2].equals("O"))
		  {
			  playerWin = true; 
			  return true;
		  }
			  
	  }
 
	  return false;
  }
  public boolean dCheck() {     
  
  }
  //AI ------------------------------------------------------------------------

   public boolean AIvCheck() {  // checks the board Vertically(row)
	  for(int c = 0; c < board[0].length; c++) {
		  if((board[0][c].equals("X") || board[2][c].equals("X")) && board[1][c].equals("X")) {
			  aiWin = true;
			  return true;
		  }
		  else if((board[0][c].equals("O") || board[2][c].equals("O")) && board[1][c].equals("O")) {
			  playerWin = true; 
			  return true;
		  }		  
	  }
 
	  return false;
}
  public boolean AIhCheck(){ // checks the board Horizontally(column)
    
	  for(int r = 0; r < board.length; r++)
	  {
		  if((board[r][0].equals("X") || board[r][2].equals("X")) && board[r][1].equals("X")) {
			  aiWin = true;
			  return true;
		  }
		  else if((board[r][0].equals("O") || board[r][2].equals("O"))&& board[r][1].equals("O")) {
			  playerWin = true; 
			  return true;
		  }		  
	  }
 
	  return false;
  }  
public void AiMove(){ //AI will pick from 3 random points and choose where to go
    int[] p1 = {0,0};
    int[] p2 = {0,0};
    int[] p3 = {0,0};
   if() {
  } else if() { 
    } else if(){
	
      }// end of the 3 random point if statement
  }
  //Player methods ------------------------------------------------------------
  public void setBoard(int r, int c){ //Sets the size of the board
   rows = r;
   cols = c;
  }
   public void mark(int r, int c){ //Marks a certain spot. PLAYERS ARE Os
   board[r][c] = "O";
  }
  
  public static void main(String[] args) {
  int x;
  Scanner in = new Scanner(System.in);
    
    
  }
}

@@ -300,16 +300,50 @@
  false;%0A
+  private boolean aiMove = false;%0A
  %0A  publ
@@ -1907,35 +1907,36 @@
 (%22X%22)) %7B%0A%09%09%09  ai
-Win
+Move
  = true;%0A%09%09%09  re
@@ -1955,152 +1955,8 @@
 %09  %7D
-%0A%09%09  else if((board%5B0%5D%5Bc%5D.equals(%22O%22) %7C%7C board%5B2%5D%5Bc%5D.equals(%22O%22)) && board%5B1%5D%5Bc%5D.equals(%22O%22)) %7B%0A%09%09%09  playerWin = true; %0A%09%09%09  return true;%0A%09%09  %7D%09
 %09  %0A
@@ -1952,34 +1952,32 @@
 ;%0A%09%09  %7D%09  %0A%09  %7D%0A
- %0A
 %09  return false;
@@ -2049,21 +2049,16 @@
 column)%0A
-    %0A
 %09  for(i
@@ -2184,35 +2184,36 @@
 (%22X%22)) %7B%0A%09%09%09  ai
-Win
+Move
  = true;%0A%09%09%09  re
@@ -2233,183 +2233,77 @@
   %7D%0A
-%09
 %09  
-else if((board%5Br%5D%5B0%5D.equals(%22O%22) %7C%7C board%5Br%5D%5B2%5D.equals(%22O%22))&& board%5Br%5D%5B1%5D.equals(%22O%22)) %7B%0A%09%09%09  playerWin = true; %0A%09%09%09  return true;%0A%09%09  %7D%09%09  %0A%09  %7D%0A
+%7D%0A %0A%09  return false;%0A  %7D  %0A  public boolean dCheck() %7B    
  %0A
-%09
   
-return false;
 %0A  %7D
-  
 %0Apub

update ai