title: Connect 5 game implementation using Java and Processing
body: <p>I am working on a Connect 5 game. There is an example of such a game <a href="https://www.mathsisfun.com/games/five-in-a-line.html" rel="nofollow noreferrer">here</a>. Even though it is not the best solution I will be using Java and <a href="https://processing.org/" rel="nofollow noreferrer">Processing</a> for GUI. I want to create a 2-D array where each element is either zero, one, or two. Initially, every element is zero, and then I will update values to be 1 or 2 depending on who's move it was. I am planning to break it up into several functions:</p>
  <pre><code>boolean gameEnd(int move){
      // returns true is player 1 or player 2 just won
      // else return false
  }
  
  void makeMove(int column, int player){
      // checks the first available square in the columns and updates the value with 1 or 2
  }
  
  void drawMap(int [][] map){
      // draws a map using processing depending on the current state of map
  }
  
  int getMove(){
      // Depending on the coordinate of the click calculate the column where the move was made
  }
  
  void setup(){
      // initialize array
      // call draw function
  }
  </code></pre>
  <p>I am a little bit skeptical about this idea and feel that it could be implemented in a better way. Also, I am not sure of the best way to implement the drawMap function. I would appreciate any help, directions, and guides on how to implement the game using Java and Processing.</p>