Write a class named HasamiShogiGame for playing an abstract board game called hasami shogi. We’ll be using the rules for “**Variant 1**” on [the Wikipedia page](https://en.wikipedia.org/wiki/Hasami_shogi), including the diagram of the starting position. Custodian captures may be made on multiple sides (up to 3 sides) of the moved piece. For example if the black piece on square h6 in the diagram below moves to square c6, then the red pieces at c4, c5, and b6 would be captured. If instead, the black piece at h6 moves to h1, then the red pieces at e1, f1, g1, and i1 would be captured.
1 2 3 4 5 6 7 8 9
a . . . . . B . . .
b . . . . . R . . .
c . . B R R . . . .
d B . . . . . . . .
e R . . . . . . . .
f R . . . . . . . .
g R . . . . . . . .
h . . . . . B . . .
i R B . . . . . . .
Locations on the board will be specified using “algebraic notation”, with rows labeled a-i and rows labeled 1-9, as shown in the diagram of the starting position shown on the Wikipedia page.
You’re not required to print the board, but you will probably find it very useful for testing purposes.
Tip: Probably the easiest way of representing the board is to use a list of lists.
Your HasamiShogiGame class must include the following:
* An init method that initializes any data members.
* A method called `get_game_state` that takes no parameters and returns ‘UNFINISHED’, ‘RED_WON’ or ‘BLACK_WON’.
* A method called `get_active_player` that takes no parameters and returns whose turn it is – either ‘RED’ or ‘BLACK’.
* A method called `get_num_captured_pieces` that takes one parameter, ‘RED’ or ‘BLACK’, and returns the number of pieces of that color that have been captured.
* A method called `make_move` that takes two parameters – strings that represent the square moved from and the square moved to. For example, make_move(‘b3’, ‘b9’). If the square being moved from does not contain a piece belonging to the player whose turn it is, or if the indicated move is not legal, or if the game has already been won, then it should just return False. Otherwise it should make the indicated move, remove any captured pieces, update the game state if necessary, update whose turn it is, and return True.
* A method called `get_square_occupant` that takes one parameter, a string representing a square (such as ‘i7’), and returns ‘RED’, ‘BLACK’, or ‘NONE’, depending on whether the specified square is occupied by a red piece, a black piece, or neither.
Feel free to add whatever other classes, methods, or data members you want. All data members must be private. Every class should have an init method that initializes all of the data members for that class.
Here’s a very simple example of how the class could be used:
game = HasamiShogiGame()
move_result = game.make_move(‘i6’, ‘e3’)
The file must be named: **HasamiShogiGame.py**
# portfolio-project Write a class named HasamiShogiGame for playing an abstract
Struggling with a similar assignment? Don’t know where to start? Don’t have time to work on this? Get a high-quality paper written for you from scratch – PLAGIARISM FREE, guaranteed to get you a good grade. To get started, please click on the Submit Your Instructions at the bottom of the page.
Need Writing Help? Our writing specialists are here 24/7, every day of the year, ready to support you! Instantly chat with an online tutor below or click here to submit your paper instructions to the writing team.
More than just an assignment.
Who is this homework service for?
* If you are having a really hard class and want to get through it, then this is for you.
* If you have a medical emergency or someone close to you has a medical emergency and you don’t think you’ll be able to turn your assignment on time, this is definitely a service you could use.
* You can use us if you are having a tough Professor who won’t give you the grades you deserve.
* If you have a tight work schedule and you are getting points deducted for not submitting assignments on time.
* English might not be your first language and you feel like you are being left behind in class because of it.
* If you have a large project coming up and don’t think you have enough time to get it done well, definitely reach out to us.
Hi there! My name is Anna.
Super stoked you are checking us out! We would like to help you with your assignment. We just need a few things from you:
* The full assignment instructions as they appear on your school account.
* If a Rubric is present, make sure to attach it.
* Any relevant weekly readings or learning resources.
* Include any special announcements or emails you might have gotten from your Professor regarding your assignment.
* Any templates or additional files required to complete the assignment.
If your assignment is somewhat complex and you need to explain it, please don’t hesitate to reach out to me via live chat.
Frequently asked questions
How soon can I get my paper done?
It depends with your deadline. If you need your paper completed in 3 hours, we will deliver it in that time. All you need to do is indicate your deadline in our custom order page here. Alternatively, if you are sending us your instructions via email, please be sure to indicate your deadline.
Will it be completely original? I don't want to be caught in a case of Academic Integrity Violation.
We are as paranoid as you are. Maybe even more! And we understand that the greatest sin you can commit in your academic journey is plagiarizing your academic work. To that end, we have made sure that we check and double-check our papers using high quality plagiarism detection tools such as SafeAssign and Turnitin before submitting the paper to you.
Who is my writer? Is he/she a native English Speaker?
All our writers are native English Speakers. That is not to say that ESL writers are not good, we just prefer hiring native writers because we want the very best people working on your paper. This might mean paying a little bit more for your paper as opposed to when you pay a foreign company whose writers are non-native English Speakers.
What if I need revisions? Will your charge additional for this?
Of course not! If you do happen to require a revision on your paper, our team will handle it for you free of charge. Matter of fact, we won’t rest till you are happy with your paper. So, ask for as many revisions as you need, it’s completely FREE!
Will you give me my money back if I don't like my paper?
We have very few instances where we delivered a paper that a client didn’t fall in love with. But if it so happens that you don’t like your paper for any reason whatsoever, we’ll refund your money back no questions asked.
I have more assignments after this, can you help me with those too?
Of course! And what’s even better is that we can reserve a writer permanently to work on your entire class. This comes in handy for projects which build up on each other and where you need just one writer, one writing style.
I got my order information wrong, can I change that?
Yes you can. Just reach out to our support team via email (email@example.com) or live chat here and they’ll help you change the instructions.
Can I place an order via email instead of going through the order page?
Yes you can. Email Anna at firstname.lastname@example.org, she’s in charge of our sales team. Alternatively, you can talk to our Live Chat team here and request to speak to Anna.