title: How can i check the winner in the my Connect four java code?
body: <p>i don't understand how to find the win way in the connect four,please tell me what should i think and how  i can find the winner in connect four.How should i use the for loop to find them.How should i use method to find the winner? </p>
  
  <pre><code>import java.util.Scanner;
  public class Connect4{
      public static  int[][] arrayboard(){
          int [][] board = new int[6][7];
          for (int i=0;i&lt;board.length;i++){
              for(int j=0;j&lt;board[i].length;j++){
                }
              }
            return board;     
           }
      public static void printboard(int[][] board){
              int k=5;
              for (int i = 0; i &lt; board.length; i++) {
                  for (int j = 0; j &lt; board[i].length; j++) {
                  System.out.print(board[i][j] + " ");
                }
               System.out.print("|"+k );
               k--;
               System.out.println();
            }
              System.out.println("--------------+");
              System.out.println("0 1 2 3 4 5 6");
         }
       public static void player1(int[][] board){
          System.out.print("player 1 type a column(0-6) or 9 to quit current game:");
          Scanner input = new Scanner(System.in);
          int column=input.nextInt();
          for (int i=5;i&gt;=0;i--){
              if(board[i][column]==0){
                 board[i][column]=1;
                 break;
              }
            }
         }
       public static void player2 (int[][] board){
          System.out.print("player 2 type a column(0-6) or 9 to quit current game:");
          Scanner input = new Scanner(System.in);
          int column=input.nextInt();
          for (int i=5;i&gt;=0;i--){
              if (board[i][column]==0){
                 board[i][column]=2;
                 break;
             }
          }
       }
      public static void main(String[] args) {
          int [][] board=arrayboard();
             printboard(board);
          boolean loop= true;
                int count=0;
           while(loop){
              if (count % 2 == 0) 
                  player1(board);
              else player2(board);
              count++;
              printboard(board);
        }
     }
  }
  </code></pre>