Creating a simple chess program

Assignment Help JAVA Programming
Reference no: EM132316531

JAVA Assignment -

For this assignment you will start creating a simple chess program. Your program will consist of 11 java files in 3 packages: In package until1228

  • Menu.java
  • Utilities.java

You will not need to change anything in until1228 (as long as it was working for the last assignment). In a package named a05

  • ChessDriver.java will be the main file for this assignment. Provided this file below, notice how it uses the Menu class you created in the last assignment.

In a package named chess:

  • Piece.java an abstract class representing a chess piece. All the chess pieces will inherit from this class.
  • Has 2 protected boolean instance variables one for the color of the piece and one that tracks if the piece has been moved yet.
  • Has 2 protected integer instance variable representing the coordinates of the piece.
  • Has a protected Board instance variable that is a reference to the board the piece is on.
  • Has a 4 parameter constructor which takes the board, a boolean for its color, and 2 integers for its coordinates. The constructor should also initialize the boolean hasBeenMoved to false.
  • Has a move method that takes 2 integer parameters and moves the piece to that location if such a move is a valid move.

If there is already a piece at the destination location that piece will be removed from the board.

  • Has an abstract boolean method isValidMove which takes 2 integer parameters and returns true if the piece can move to that location.
  • Has an abstract char method getSymbol that takes no parameters and returns the symbol of the piece (k for King, q for Queen, r for Rook, b for Bishop, n for Knight, p for Pawn).

If the piece is white the symbol should be uppercase, if the piece is black the symbol should be lowercase.

  • King.java, Queen.java, Rook.java, Bishop.java, Knight.java, Pawn.java
  • Each has a 4 parameter constructor which takes the board, a boolean for its color, and 2 integers for it coordinates. This constructor can just make use of the Piece constructor.
  • Each has an implementation of the isValidMove method. For this week these methods will just always return true. (We will worry about fixing this to follow chess rules next week).
  • Each has an implementation of the getSymbol method which returns the correct symbol based on the piece type and color.
  • Board.java defines a chess board object.
  • Has a protected 8 by 8 2d array of Piece objects representing the positions on a chess board
  • Has a single zero parameter constructor that creates the 2d array and then creates all the pieces and puts them in their proper starting position in the array.
  • Has a display method that prints a representation of the board to the screen, the format for the display can be seen in the sample output.
  • Has a move method that moves a piece to a new location (using the move method of the piece). This method takes 4 parameters: coordinates of the piece and coordinates to move the piece to. The method will print error messages if the coordinates are not on the board or if there is no piece at the first coordinates location.

Attached a sample run of the program, note that coordinates on the board are ordered column then row. So 3 7 is column 3 and row 7.

IMPORTANT: You will submit a single .jar file make sure that:

1) The jar file runs. In project properties under run make sure the main class is set to a05.ChessDriver

2) The jar file includes all your source code. In project properties under packaging make sure .java files are not excluded.

Attachment:- Assignment Files.rar

Reference no: EM132316531

Questions Cloud

Outline techniques for dealing with customers : Outline techniques for dealing with customers including customers with specific needs.
Submit complete case analysis of case in drucker : Complete and submit your case analysis of Case 2 in the Drucker, Peter F. (2009). Management Cases, Revised ed. New York, NY: Collins Business,
Case - detect excessive shock using phones sensor data : Calculate the time of operation between each stop and start - identify the orientation of the phone to display in debug - Process of app deployment
Determine for the month of march cost per equivalent unit : Alpha Company, on March 1, 2017 has a beginning Work in Process inventory of zero. All materials are added into production at the beginning.
Creating a simple chess program : JAVA Assignment - For this assignment you will start creating a simple chess program. Your program will consist of 11 java files in 3 packages
Discuss the individual reflection assignment : Discuss the Individual Reflection Assignment, Individual Reflection Assignment, Individual reflective journal
Discuss the steps involved in the audit planning process : Explain the incentives, opportunities and attitudes the auditor should be aware of in considering the risk of misappropriation of asset fraud.
Develop future state value stream map for the service : Develop a future state value stream map for the service(Human service). Reflect on the challenges encountered when developing the future state map.
What are the weapons of competition : What are the "weapons of competition" that rival companies in your industry (UBER) can use to gain sales and market share?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write partial code using a loop to produces the given output

CSE 110- Write partial code using a loop to produces given output. Write a Java program called Assignment4.java. There are two tasks in this assignment. Your program will ask for user choice and based on which it will switch between the two tasks.

  Develop an athlete class that has the persons name

Develop an Athlete class that has the person's name, sport, and ranking, where the name and sport are Strings and the ranking is anything.

  Ask the user to input a grade (integer from 1-100)

Program should still ask the user to input a grade (integer from 1-100) and then output the letter grade.  Scale:  Greater than 90 is an "A"; Greater than 80 to 90 is a "B", Greater than 70 to 80 is a "C", Greater than 60 to 70 is a "D", and 60 or le..

  Make a method that print the name of the store

purpose of this method is to print the name of the store that provides the cheaper price. If both prices are the same, print the names of both stores.

  Create a class of students in a college

Create a class of students in a college. Make sure you include the following instance/member variables - Create a non-default constructor

  Write a program creates circlearray

Write a program creates circleArray, an array composed of 10 Circle objects; it then initializes circle radius with any values (increase every time radius value by 5) and displays all circle object area's And also find total area of the circleArra..

  Prepare a new project in your ide named animalinfo

Prepare a new project in your IDE named AnimalInfo. Create a class called AnimalInfo as the main class for the program.

  Develop a working program either an authentication system

Develop a working program either an authentication system for the zoo designed to follow the specifications outlined in the overview.

  Programming using the java language

Programming using the Java language. The basic concepts of object-oriented programming. Topics used will include algorithmic logic, control structures, data and program design, objects and classes.

  Assessment taskyour task is to develop a java application

assessment taskyour task is to develop a java application that allows the user to read travel booking data from a text

  What is printed out by the following code

What is printed out by the following code

  Build a flowchart that models a complete java program

Using a flowcharting tool of your choice, build a flowchart that models a complete Java program called PasswordChecker that gets a String from the user at the command line and checks whether the String, called password, conforms to the password..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd