Find Jobs
Hire Freelancers

A chess game in python -- 2

$10-30 USD

Completed
Posted over 3 years ago

$10-30 USD

Paid on delivery
To do this, we will need you to create different types of chess pieces to populate the board. All Chess_Pieces will have some of the same properties: a unique ID (represented by a string), a position on a board represented by an (x, y) coordinate, a color (represented by a string), a direction (“UP” or “DOWN”), and a board size (expressed as a tuple of (width, height)). The default size of the chess board should be 8×8. However, this should be configurable by parameter. Regardless of the size of the board, (0,0) should be considered to be in the lower, left hand corner. Keep in mind that the orientation of the board does matter, but assume the coordinate system’s origin is the lower left hand corner from where you are viewing the chess board (See image below of standard 8x8 chess board). If a piece is not on the chess board yet, its position should be (None, None). All Chess_Pieces will also have some universally similar behaviors: If a Chess_Piece is not already on the board, it should be able to be placed on any valid position on the chess board. The Chess_Piece should be able to move to a position that is a valid movement position for the piece (although the list of valid moves is not specified within the Chess_Piece class itself, since each Chess_Piece has its own rules for movement). Any Chess_Piece should be able to be removed from the board at any point. Finally, a Chess_Piece can try to take another piece. This is done (generally; note the exception for Pawns, below) by checking to see if the other Chess_Piece is on a position that this Chess_Piece can move onto. With the general behavior of all Chess_Pieces defined, we need to define the behaviors of individual pieces. A Pawn is a Chess_Piece that can only move one or two spaces in the direction that it is facing. A Knight is a Chess_Piece that moves by leaping in an “L-shape,” meaning that it moves one space ahead and two spaces to a side OR two spaces ahead and one space to a side. These spaces are the only spaces that the Knight can land on to move or take another piece and any Chess_Pieces in any intermediate space are safe. A King is a Chess_Piece that can only move one space in any of the 8 directions (straight line or diagonal). Finally, there are three pieces that have a strong similarity in behavior. A Bishop is a Chess_Piece that can move diagonally for 1 or more positions. A Rook is a Chess_Piece that can move laterally (horizontally or vertically) for 1 or more positions. Finally, a Queen is a Rook that can move diagonally OR laterally (horizontally or vertically) for 1 or more positions. None of these three types of Chess_Pieces need to check for obstructions when determining valid moves and can take a Chess_Piece if the target Chess_Piece in a position that is in the list of valid moves. Lab Requirements For this lab, create 7 different classes using object-oriented principles and design to implement the above behaviors. These objects are to be called Chess_Piece, Pawn, Knight, King, Bishop, Rook, and Queen. Any Chess_Piece will have its ID, initial position, color, and direction declared at instantiation. Each Chess_Piece can also have the size of the chess board it is on declared at instantiation but, if it is not, then the board size should default to the standard 8×8 board. Every other object is a Chess_Piece; however, we are going to consider the Queen to also be a more specific type of Rook. The Chess_Piece class should be in its own code file named chess_piece.py. All other classes should be included into a single file called pieces.py. All objects will have pure accessor methods for ALL state variables. Additionally, all objects will have an accessor method that checks if piece is on the chess board. If it is, it should return True and False otherwise. Finally, the method get_valid_moves should return a list of tuples representing all of the valid moves for the given piece.
Project ID: 27458620

About the project

2 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi I have read your description before an hour I think. I can do your task. I have 3+ years of experience in Python and OOP. It will be done not just before friday but tomorrow. Feel free to send a message please.
$30 USD in 1 day
5.0 (25 reviews)
4.5
4.5
2 freelancers are bidding on average $30 USD for this job
User Avatar
Hello ! I am Khadidja, Computer Vision graduate, I worked on lots of OOP and Python projects I would be glad to help Thank you for considering me !
$30 USD in 2 days
5.0 (2 reviews)
1.4
1.4

About the client

Flag of UNITED STATES
Seven Valleys, United States
0.0
0
Payment method verified
Member since Sep 21, 2020

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.