Question: Design a simple program to play a simplified version of checker. Specifically, the program has to print the board and then alternatively ask the correct

Design a simple program to play a simplified version of checker. Specifically, the program has to print the board and then alternatively ask the correct player to insert the old and the new coordinates of the piece to move. The system has to check whether the coordinates refer indeed to a player's owned piece and that the new position fulfills the requirements (i.e., diagonal forward move in an empty cell). The program has to continue until the user terminates it by entering a coordinate as value -1. No jumps (or multiple jumps) and no piece crowning should be implemented.
Here is an example of "gameplay" (in blue are the inputs provided by the user):
01234567- X axis
+----------------+
0|1111|
1|1111|
2|1111|
3||
4||
5|2222|
6|2222|
7|2222|
+----------------+
01234567
Turn of player no.1
Coordinate of piece to move
Enter X: 1
Enter Y: 2
Coordinate of new position
Enter X: 0
Enter Y: 3
Piece moved!
01234567- X axis
+----------------+
0|1111|
1|1111|
2|111|
3|1|
4||
5|2222|
6|2222|
7|2222|
+----------------+
01234567
Turn of player no.2
Coordinate of piece to move
Enter X: 0
Enter Y: 5
Coordinate of new position
Enter X: 1
Enter Y: 4
Piece moved!
01234567- X axis
+----------------+
0|1111|
1|1111|
2|111|
3|1|
4|2|
5|222|
6|2222|
7|2222|
+----------------+
01234567
Turn of player no.1
Coordinate of piece to move
Enter X: 2
Enter Y: 1
Coordinate of new position
Enter X: 1
Enter Y: 2
Piece moved!
01234567- X axis
+----------------+
0|1111|
1|111|
2|1111|
3|1|
4|2|
5|222|
6|2222|
7|2222|
+----------------+
01234567
Turn of player no.2
Coordinate of piece to move
Enter X: -1
Initial code
The code you must start from is the following (no package declaration, class name Checker):
import java.util.Scanner;
public class Checker {
}to insert the old and the new coordinates of the piece to move. The system has to check whether the coordinates refer indeed to a player's owned piece and
that the new position fulfills the requirements (i.e., diagonal forward move in an empty cell). The program has to continue until the user terminates it by
entering a coordinate as value -1. No jumps (or multiple jumps) and no piece crowning should be implemented.
Here is an example of "gameplay" (in blue are the inputs provided by the user):
Turn of player no.1
Coordinate of piece to move
Enter X: 1
Enter Y : 2
Coordinate of new position
Enter X: 0
Enter Y: 3
Piece moved!
Turn of player no.2
Coordinate of piece to move
Enter X: 0
Enter Y:5
Coordinate of new position
Enter X: 1
Enter Y: 4
Piece moved
Turn of player no.1
Coordinate of piece to move
Enter X: 2
Enter Y: 1
Coordinate of new position
Enter X: 1
Enter Y: 2
Piece moved!
Turn of player no.2
Coordinate of piece to move
Initial code
The code you must start from is the following (no package declaration, class name Checker):
import java.util.Scanner;
public class Checker {
 Design a simple program to play a simplified version of checker.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!