Java please
Our program should accept input in one of two ways:
If a command-line argument is provided, it should read input
from the file given as that argument.
If no command-line arguments are provided, the program should
read input directly from the terminal.
Each input will be given on its own line, and will follow this
format exactly:
The first input will be the number of rows, mm, for the grid of
squares on the board. It will be an integer value between 1 and 256
(1≤m≤256 1≤m≤256).
The second input will be the number of columns, nn, for the
grid of squares on the board. It will be an integer value between 1
and 256 (1≤n≤2561≤n≤256).
Each following input will consist of two lines, xx and yy,
giving the coordinates in the grid where that player places her or
his symbol. It is guaranteed that xx and yy will reference a valid
space on the board (0≤x<m0≤x<m and 0≤y<n0≤y<n). You do
not need to check that these inputs are valid.
Here are the rules for a more generalized form of Tic-Tac-Toe,
which uses a board of varying size:
The first player picks a number of rows for the grid of squares
on the board.
The second player picks a number of columns for the grid of
squares on the board.
The first player places a symbol, typically an X, in an
empty square.
The second player places a symbol, typically an O, in an
empty square.
The players alternate turns until one player is able to fill an
entire row or column with her or his symbol. That player is the
winner.
If the number of rows and columns are equal, players may also
win by filling an entire diagonal with the same symbol.
If all squares are filled and no player wins, it is considered
a draw.
To complete this project, you’ll create a program that allows
two players to play this game.
Sample Input and Output
Input 1
3
3
0
0
0
1
1
1
0
2
2
2
Output 1
Winning move at 2 2
Input 2