I am working on a school project, building a Chess-game. I have my board which creates the arrays and fill the board with pieces.
Now, I want to instantiate a new board in a game class and use the console to input player moves. To make this as simple as possible, my trouble is inputting non-static variables.
For instance:
public class Test extends ConsoleProgram{
public static double a1;
public static void main(String[] args) {
a1 = readLine("Insert value of a1");
System.out.println(a1);
}
}
As you probably see, this won't work as java
is complaining cannot make static reference to the non-static method readLine()
How do I work around this? Maybe there is something really basic I just don't understand..
As always, thank you very much for your quick and insightful answers!