subject

Write a class named GessGame for playing an abstract board game called Gess. Rules below. Note that when a piece's move causes it to overlap stones, any stones covered by the footprint get removed, not just those covered by one of the piece's stones. It is not legal to make a move that leaves you without a ring. It's possible for a player to have more than one ring. A player doesn't lose until they have no remaining rings. Locations on the board will be specified using columns labeled a-t and rows labeled 1-20, with row 1 being the Black side and row 20 the White side. The actual board is only columns b-s and rows 2-19. The center of the piece being moved must stay within those boundaries. An edge of the piece may go into columns a or t, or rows 1 or 20, but any pieces there are removed at the end of the move. Black goes first. Probably the easiest way of representing the board is to use a list of lists. You're not required to print the board, but you will probably find it very useful for testing purposes. Your GessGame 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', 'BLACK_WON' or 'WHITE_WON'.A method called resign_game that lets the current player concede the game, giving the other player the win. A method called make_move that takes two parameters - strings that represent the center square of the piece being moved and the desired new location of the center square. For example, make_move('b6', 'e9'). If the indicated move is not legal for the current player, or if the game has already been won, then it should just return False. Otherwise it should make the indicated move, remove any captured stones, update the game state if necessary, update whose turn it is, and return True. Feel free to add whatever other classes, methods, or data members you want. All data members must be private. Whether you think of the array indices as being [row][column] or [column][row] doesn't matter as long as you're consistent. Here's a very simple example of how the class could be used:game = GessGame()move_result = game. make_move('e3', 'e6')game. make_move('e14', 'g14')state = game. get_game_state()game. resign_game()The file must be named: GessGame. py

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
You know the right answer?
Write a class named GessGame for playing an abstract board game called Gess. Rules below. Note that...
Questions
Questions on the website: 13722363