Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to develop a Checker Board in Java and stuck with the code. Please help: 1. Insert code here: a. PRINT PIECE NAME

I am trying to develop a Checker Board in Java and stuck with the code. Please help:

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

1. Insert code here: a. PRINT PIECE NAME b. To get a piece off a square *1 C. SetPieceOnSpace method *1 d. removePieceOnSpace method * 1 e. put an empty piece on a square * 3 f. put an actual piece on a square *2 2. Square class : a. Populate Square class with relevant data b. I need to be able to store a piece on a space C. Remove a piece from that space d. No answers given, you have flexibility here. 3. You should NOT need to modify the Main class at all. When you run the program in your IDE, after you've made your changes, it should work just as displayed in class (example provided below): --3-@ ---3-4___ __0-0____R0-1___0-2____RO-3___0-4____R0-5___0-6____R0-7_ __R1-0___1-1____R1-2___1-3____R1-4___1-5____R1-6___1-7__ __2-0____R2-1___2-2____R2-3___2-4____R2-5___2-6____R2-7_ 3-1 _3-2. 3-3__ 3-5_ 3-6____3-7_- --4-0__-_4-1_--_4-2----4-3_---4-4----4-5_-_-4-6_---4-7-- __W5-0___5-1____W5-2___5-3____W5-4___5-5____W5-6___5-7__ __6-0____W6-1___6-2____W6-3___6-4_--_W6-5_-_6-6____W6-7- __W7-@___7-1 _W7-2___7-3____W7-4___7-5. _W7-6___7-7__ -=NEW BOARD==== 0-1 _0-2____RO-3___0-4____R0-5___0-6____RO-7_ __R1-0___1-1_--_R1-2___1-3_--_R1-4___1-5_--_R1-6___1-7_- __2-0__-_R2-1___2-2____R2-3___2-4____R2-5___2-6____R2-7_ _R-1_3-2 -- 3-3 - 3-4 -- 3-5 -- 3-6 -- 3-7 - __4-0____4-1____4-2____4-3____4-4____4-5____4-6____4-7__ __W5-0___5-1_--_W5-2___5-3____W5-4___5-5____W5-6___5-7_- --6-@_. _W6-1_-_6-2____W6-3___6-4_-_-_W6-5_-_6-6____W6-7_ __W7-0___7-1____W7-2___7-3____W7-4___7-5____17-6___7-7__ --3-0 Main Class 8 10 Main.java X Board.java Square.java RegularPiece.java Piece.java 1 package com.company; 2 36 import java.lang.reflect. Array; . 9 public class Main 1 11 //Broken_Checkers_For_class_To_Fix public static void main(String[] args) throws InterruptedException { ArrayList currentPieces = new ArrayList(); Scanner myScanner = new Scanner(System.in); Board myBoard = new Board(); ArrayList pieces = new ArrayList(); pieces = myBoard.showBoard(); 19 1/I am picking up piece Re-1 and moving it to square 3-1 4320 myBoard.setPieceOnSpace(pieces.get(1),3,1); 21 System.out.println("--- =========NEW BOARD========== 1/I am removing piece RC-1 from it's original position at 0,1) 323 myBoard.cemevePieceOnSpace(0,1); 1/The board will display R0-1 on it's new square pieces = myBoard.showBoard(); 26 } 27 ) 12 13 14 15 16 17 18 "); 22 24 25 Piece Class 6 9 Main.java Board.java Square.java RegularPiece.java Piecejava X 1 package com.company; 2 3 public interface Piece { 4 //Fixing sit 5 1/public boolean move (Board board, int x, inty, Player player); //commented out until we start work on Pieces. public boolean isdump(Piece pce, int x, int y); 7 public String getName(); 8 public void setName(String name); public int getId(); 10 public int getxCord(); 11 public void setxCord(int xCord); 12 public void setyCord(int yCord); public int getyCord(); public String getColor(); 15 public int getForwrdMove(); 16 public int getJumpMove(); 17 public int getStatus(); 18 public void setstatus(int status); 19 public void setKingRow(int kingRow), 20 public int getKingRow(); 21 public void setFullName(String fullName); 22 public String getFullName(); 23 24 25} 26 13 Board Class: 2 5 8 9 10 11 12 130 14 15 16 19 20 21 } Main.java Board.java X Square.java RegularPiece.java Piece.java 1 package com.company; Os 30 import java.lang.reflect. Array; 4 import java.util.ArrayList; 6 public class Board { 7 //Fixing git ArrayList(); ArrayList whitePieces = new ArrayList(); Square[][] squares = new Square [8] [8]; public Board() { this.setBoard(); } 171 180 public void setBoard() { //we need to create squares in an 8x8 grade for (int x = 0; X templist - new ArrayList(); for (int x = 0; X pieces, String color, int move, int jump) { 61 int pieceCounter - @; 62 for(int y = 0;y pieces, String color, int move, int jump) { 93 int pieceCounter = 0; 94 for(int y = @;y showBoard() { 1/print first row ArrayList tempList - new ArrayList(); for (int x = @; x currentPieces = new ArrayList(); Scanner myScanner = new Scanner(System.in); Board myBoard = new Board(); ArrayList pieces = new ArrayList(); pieces = myBoard.showBoard(); 19 1/I am picking up piece Re-1 and moving it to square 3-1 4320 myBoard.setPieceOnSpace(pieces.get(1),3,1); 21 System.out.println("--- =========NEW BOARD========== 1/I am removing piece RC-1 from it's original position at 0,1) 323 myBoard.cemevePieceOnSpace(0,1); 1/The board will display R0-1 on it's new square pieces = myBoard.showBoard(); 26 } 27 ) 12 13 14 15 16 17 18 "); 22 24 25 Piece Class 6 9 Main.java Board.java Square.java RegularPiece.java Piecejava X 1 package com.company; 2 3 public interface Piece { 4 //Fixing sit 5 1/public boolean move (Board board, int x, inty, Player player); //commented out until we start work on Pieces. public boolean isdump(Piece pce, int x, int y); 7 public String getName(); 8 public void setName(String name); public int getId(); 10 public int getxCord(); 11 public void setxCord(int xCord); 12 public void setyCord(int yCord); public int getyCord(); public String getColor(); 15 public int getForwrdMove(); 16 public int getJumpMove(); 17 public int getStatus(); 18 public void setstatus(int status); 19 public void setKingRow(int kingRow), 20 public int getKingRow(); 21 public void setFullName(String fullName); 22 public String getFullName(); 23 24 25} 26 13 Board Class: 2 5 8 9 10 11 12 130 14 15 16 19 20 21 } Main.java Board.java X Square.java RegularPiece.java Piece.java 1 package com.company; Os 30 import java.lang.reflect. Array; 4 import java.util.ArrayList; 6 public class Board { 7 //Fixing git ArrayList(); ArrayList whitePieces = new ArrayList(); Square[][] squares = new Square [8] [8]; public Board() { this.setBoard(); } 171 180 public void setBoard() { //we need to create squares in an 8x8 grade for (int x = 0; X templist - new ArrayList(); for (int x = 0; X pieces, String color, int move, int jump) { 61 int pieceCounter - @; 62 for(int y = 0;y pieces, String color, int move, int jump) { 93 int pieceCounter = 0; 94 for(int y = @;y showBoard() { 1/print first row ArrayList tempList - new ArrayList(); for (int x = @; x

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago