提供高质量的essay代写,Paper代写,留学作业代写-天才代写

首頁 > > 詳細

代寫CS4233代做Java

CS4233 Programming Assignment
Generic Piece Move Validation
Gary F. Pollice
March 28, 2020
Introduction
Many board games, such as chess, checkers, and Stratego, have pieces that have their movement constrained
in different ways. Many properties and rules determine the constraints and during the game, a human or
program would look at the constraints to determine if the piece can move from one location on the board to
another without violating the constraints. This assignment requires you to extend a small, flexible example
to implement and test code that checks whether pieces in the game of chess may make a specified move,
given a board that provides the locations of pieces, and the starting and ending squares of the move that
the piece wants to make. You simply have to return Yes (true) or No (false).
This assignment has these objectives:
• let you practice TDD and the process described for this course
• learn or improve your knowledge and application of interfaces and generics in Java
• improve your understanding of abstraction and separation of concerns
• learn or improve your knowledge of lambdas in Java
You should read this document carefully and ask any questions about it in the discussion thread for this
assignment that you will find on Canvas. We look at these several times a day and we expect students to
do the same. If you have an answer to a post in a discussion, feel free to provide the answer unless the
discussion explicitly asks you not to.
Download the starting code for this assignment and use it as your base for starting work. Try to follow the
code style in the base code. The Canvas site has the formatting conventions that we use, feel free to install
them in your Eclipse. Take time to look over the code and the initial design described in this document
before starting to modify it. Spending a few minutes to understand the organization and purpose of each
class and method will save a couple of hours reworking code that might be in error.
You should follow the TDD approach described previously as strictly as possible in order to ensure that
you’re doing it correctly and also to let you evaluate the effectiveness of using this approach as one of your
personal process practices.
Prerequisites
First, you need to know a little bit about chess an how the pieces move. In general, the moves are straight
forward, like the ability to move a rook orthogonally (horizontally or vertically) any number of squares as
long as there are no intervening pieces. We will use these rules of chess as our official guide. We will not use
the “en passant” special rule. You do not need to know all of the special rules, but you should pay special
attention to the Learn to move the Pieces section.
1
Next you need to download the starting code and load the java project into Eclipse. The starting code
is stored as an Eclipse Java project in a zip archive. You simply select File→Import...→General and then
select Existing Projects into Workspace. Make sure that after clicking the Next button that you click on the
Select archive file radio button and follow the prompts to import the project. We suggest that you keep this
in a private git repository. Make sure that you have have installed a Java JRE that is at the Java 8 level
or higher. You can ensure that the project has imported properly by selecting the project in the Project
Browser and then right click and choose Run As→JUnit Test. All tests except one should pass.
Next, take time to understand the code. See the code description in the next section of this manual.
There may be videos provided in the module on Canvas if you need them. Make your task list, write some
tests and start implementing the required functionality.
The starting code base
This section describes the starting code base. We use UML diagrams to describe the structure and elaborate
with text as needed.
Package structure
The code base consists of three packages (Figure 1). Two contain core elements and utilities that might be
used for many types of games. The other package contains the chess-specific code. This is where all classes
that are unique to the game of chess, and this assignment belong.
Figure 1: Packages in the starting code.
Each of these packages contains classes that are logically grouped. The general contents of each package
are
2
gpv This is the top-level package. The files contained in this package are all
generic-based and are extended for each particular game type.
gpv.util This package contains utility files like Board that might be used in any game.
As the framework expands, some of these might go into the gpv package or
some other package that contains generic classes that must be extended for
specific games.
gpv.chess This package contains all of the classes for this assignment that are specific
to the game of chess.
Top-level interfaces
There are three interfaces in the top level package, gpv (Figure )2). These describe the basic behaviors and
connections between the main abstractions for this assignment.
Figure 2: Top-level interfaces.
Notice that two of the interfaces are generic and have generic type parameters. The following sections
describe the purpose of each of these.
Piece
This is the main abstraction for the assignment. You will be implementing chess pieces that have different
constraints placed on their movement. The Piece interface describes the behavior that any piece must supply
to its clients. The primary behavior is canMove(). Given a board state (i.e. the board and current location
of any pieces) and two coordinates that indicate the source and destination of the move, this boolean method
simply returns a yes/no response (true/false) that tells the client whether the proposed move is legal.
The Piece is generic. We want to be able to use it for any game, even though for this assignment, we
will focus only on the game of chess. The generic type parameter for this is D, where D must implement
the PieceDescriptor interface. The intention is that the descriptor contains the necessary information to
describe the piece’s properties. Any piece must have a getter method getDescriptor() that returns this
descriptor.
PieceDescriptor
This is a marker interface. That is, it describes no methods, but any piece descriptor must implement it.
This lets the Java compiler generate the appropriately typed classes. Any given game and its pieces may
implement the piece descriptors as it sees fit. The concrete descriptor may be a class or an enumeration.
3
PieceFactory

聯系我們
  • QQ:1067665373
  • 郵箱:1067665373@qq.com
  • 工作時間:8:00-23:00
  • 微信:Badgeniuscs
熱點文章
程序代寫更多圖片

聯系我們 - QQ: 1067665373 微信:Badgeniuscs
? 2021 uk-essays.net
程序代寫網!

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack 北美最专业的线上写作专家:网课代修,网课代做,CS代写,程序代写 代码代写,CS编程代写,java代写北美最好的一站式学术代写服务机构 美国essay代写,作业代写,✔美国网课代上-最靠谱最低价 美国代写服务,作业代写,CS编程代写,java代写,python代写,c++/c代写 代写essay,作业代写,金融代写,business代写-留学生代写平台 北美代写,美国作业代写,网课代修,Assignment代写-100%原创 北美作业代写,【essay代写】,作业【assignment代写】,网课代上代考