import java.util.Scanner; class TableBlock { private int cellRow; private int cellColumn; private char type='E'; //--> a simple getter public int getRow() { return cellRow; } //--> a simple getter public int getColumn() { return cellColumn; } //--> a simple getter public char getBlockType() { return type; } public void setBlockType(char myType) { type=myType; } //--> constructor for Block, gets row and column public TableBlock(int row, int column) { cellRow=row; cellColumn=column; } } class Table { public char RightTurn= 'R' ; public boolean isWinner=false; private int tableRow; private int tableColumn; //--> a simple getter public int getRowNum() { return tableRow; } //--> a simple getter public int getColumnNum() { return tableColumn; } //--> a simple getter private TableBlock[][] AllBlocks; public TableBlock[][] getBlocks() { return AllBlocks; } //--> constructor for Table, gets rowNum and columnNum public Table(int rowNum, int columnNum) { tableRow=rowNum; tableColumn=columnNum; AllBlocks = new TableBlock[tableRow][tableColumn]; for(int i=0;i=0&& i+3 a simple getter public Table getTable() { return Board; } //--> a simple getter public char getTurn() { return turn; } //--> constructor for FourInARow, gets table; initializes turn, and creates rowTop[] public FourInARow(Table table) { Board=table; } //--> this is the main function, all methods occur in this... //--> checking errors at first, modifying new block and checking winner or the equality case. public String play(char turn, int column) { if(turn != Board.RightTurn) return "error"; else { if(Board.RightTurn=='R') Board.RightTurn='Y'; else if(Board.RightTurn=='Y') Board.RightTurn='R'; } Boolean Equal=false; if(Board.isWinner==true) return ""; if(column>=Board.getColumnNum()) return "error"; else if(Board.getBlocks()[0][column].getBlockType()!='E') return "error"; else { for(int i=(Board.getRowNum()-1) ; i>=0; i--) if(Board.getBlocks()[i][column].getBlockType()=='E') { Board.getBlocks()[i][column].setBlockType(turn); break; } // for(int i=0;i