Question
IN JAVA LANGUAGE!! public class ChessBoard { // Array of pieces values Rook, Knight, Bishop, King, Queen, Bishop, Knight, Rook static private final char []
IN JAVA LANGUAGE!!
public class ChessBoard { // Array of pieces values Rook, Knight, Bishop, King, Queen, Bishop, Knight, Rook static private final char [] WHITE_PIECES = { '\u2656', '\u2658', '\u2657', '\u2655', '\u2654', '\u2657', '\u2658', '\u2656' }; // unicode value of a pawn static private final char PAWN = '\u2659'; // our choice for "empty square" - medium rectangle ... static private final char EMPTY = '\u25AD'; private static final int ROWS = 8; private static final String HEADING = "----------------------------------------- " + " Unicode Symbols Chessboard " + "----------------------------------------- "; // Black piece values are equiv white pieces + 6 private static final int BLACK_PIECE_DISPLACEMENT = 6; static private void displayHeading() { System.out.println(HEADING); } private static void displayBoard() { for(int row = ROWS ; row >= 1 ; --row ) { System.out.printf("%-5d", row);
/** * COMPLETE LOGIC THAT DISPLAYS REST OF BOARD HERE */ System.out.println(""); // } } // Only Public Method Used Directly By main() static public void display() { displayHeading(); // display heading displayBoard(); } /** * @param args */ public static void main(String[] args) { // invoke display method ChessBoard.display(); } }
The output on the left is what you should get generated by the provided partially completed program. The output on the right is what your completed, to be submitted program should generate. Current-State Output Completed-State Output Unicode Symbols Chessboard UNICODE SYMBOLS CHESSBOARD ------------------------------- - - - - ** DHI i Norm and will O O O O 30 ml D D D O - OOO al - ODO O O O O OD 0 0 n ce o a ot 1. The heading to be upper-cased. 2. The chessboard lines 1-8 are to be filled in with the appropriate Unicode characters: a. Row 8 - black pieces: rook, knight, bishop, king, queen, bishop, knight, rook b. Row 7 - black pieces: 8 pawns C. Rows 6 through 3: 8 rectangles indicating empty squares d. Row 2 - white pieces: 8 pawns e. Row 1 - white pieces: rook, knight, bishop, king, queen, bishop, knight, rookStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started