 // square status
 int redStatus [] = {0,0,0,0,0,0,0,0,0};
 int greenStatus [] = {0,0,0,0,0,0,0,0,0};
+int previousGreenStatus [] = {0,0,0,0,0,0,0,0,0};
 
 // conditions for victory
 int winConditions [][9] = {{1,1,1,0,0,0,0,0,0},

  } else if (greenVictory){
    victoryLoop('g');
  }
  */

}


  while(doLoop){
    if (display.buttonsChanged()) {
      byte reply = display.getButtons();
      // Green button
      if ((reply & 0x04) == 0x00){
          doLoop = false;
      }
    }  
  }
  display.clear();
  display.printText("Starting new game!", 6, 1, GREEN);  
}

void msgAndWait(String msg){
  display.clear();
  display.printText(msg, 6, 1, RED);
  boolean doLoop = true;
  while(doLoop){
    if (display.buttonsChanged()) {
      byte reply = display.getButtons();
      // Green button
      if ((reply & 0x04) == 0x00){
          doLoop = false;
      }
    }  
  }
  display.clear(); 
}

void printMsg(String msg){
  display.clear();
  display.printText(msg, 6, 1, BLUE);
}

/**********************************************
 *   COMMUNICATION WITH THE GAME SERVER
 **********************************************/

int findPlayer(){
  //TODO
  // rival_id = send ("REGISTER " + player_id + "\0n")
  // returns the rival_id
  return 113;

}

int getMove(){
  //TODO
  // move = send ("GET_MOVE " + rival_id)
  return 0;
}

void sendMove(int player_move){
  //TODO
  // send ("MOVE " + player_move + player_id)
  return 0;
}


