讲解:CSE231、Python、AI、PythonC/C++|Matlab

CSE231 Fall 2018Project 10: English CheckersThis assignment is worth 55 points (5.5% of the course grade) and must be completed and turned in before 11:59pm onTUESDAY November 27, 2018.Assignment Overview:How to use a custom-built Python class. In this project you are going to write Python program that uses an ArtificialIntelligence (AI) module to play the game of Checkers against a human. The AI module and a couple of other functions areis already written and you are going to use those in your program.Assignment Background:You will implement a classical board game called Checkers in Python using classes. Checkers is a group of strategy boardgames for two players which involve diagonal moves of uniform game pieces and mandatory captures by jumping overopponent pieces. The game is usually played on an 8x8 “checkered” board. For an 8x8 board, there are twelve black andtwelve white identical game pieces called Pawns (or Men).Game Rules and Objective:Checkers is played by two opponents, on opposite sides of the game board. One player has the black pieces; the other has thewhite pieces. Players alternate turns. A player may not move an opponents piece. A move consists of moving a piecediagonally (forward from the player’s side) to an adjacent unoccupied square. If the adjacent square contains an opponentspiece, and the square immediately beyond it is vacant, the piece may be captured (and removed from the game) by jumpingover it. Only the dark squares of the checkered board are used. A piece may move only diagonally into an unoccupied square.Capturing is mandatory in most official rules. In almost all variants, the player without pieces remaining, or who cannot movedue to being blocked, loses the game.Pawn/Man: Uncrowned pieces, i.e pawns, move one step diagonally forwards, and capture an opponents piece by movingtwo consecutive steps in the same line, jumping over the piece on the first step. Multiple enemy pieces can be captured in asingle turn provided this is done by successive jumps made by a single piece; the jumps do not need to be in the same lineand may zigzag (change diagonal direction). In English Checkers pawns can jump only forwards.Kings: When a pawn reaches the kings row (also called crownhead, the farthest row forward), it becomes a king, and ismarked by placing an additional piece on top of the first pawn, and acquires additional powers including the ability to movebackwards and (in variants where they cannot already do so) capture backwards. Like pawns, a king can make successivejumps in a single turn provided that each jump captures an enemy pawn or king. More details on this game can be found here:https://en.wikipedia.org/wiki/DraughtsIn fact, the best way to learn the rules is to play the game first hand, you can play the game here:http://www.247checkers.com/The checkers.py file, Board and Piece class:The Board and Piece classes are defined in the checkers.py file. So you have all the tools already to be used in a game.You will use this class to write your game logic. You must not modify this class. The first thing you need to do is to readthis file and understand each function and variables in both of the classes. There is also a main function that testsdifferent functionalities of Board and Piece objects. Read, run and see the main function outputs to understand how theclasses work.The game play:Unfortunately we dont have any nice user interface for the game. What you are going to implement is a text based commandline interface. When you start/run the game, it will look like this:Developed by The Students Inc.CSE231 Summer Semester 2018Michigan State UniversityEast Lansing, MI 48824, USA.Pick a color:First the game will ask for which color you are going to choose, then you type black or white. Once chosen yours andopponents color are fixed. In our case, black will always play the first move. In our case the pawns will be denoted by band w, the kings will be denoted by B and W (for black and white respectively). The board is composed of 8x8 “cells” andinitialized with 12 black and 12 white pieces (for 10x10 board there will be 20 black and 20 white pieces etc.). In the startingposition the pieces are placed on the first three rows closest to the players. This leaves two central rows empty. The whiteswill be placed at the bottom rows and blacks on the top. The last white row will start from the bottom left corner and thepieces will be placed by skipping every other cell. The rows on the board is numbered as a, b, c, ..., h and thecolumns as 1, 2, 3, ..., 8 etc. 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | b | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+d | | | | | | | | | +---+---+---+---+---+---+---+---+e | | | | | | | | | +---+---+---+---+---+---+---+---+f | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+g | | w | | w | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+Figure 0: Initial boardIf you run the program (proj10.py), the game will start as followsDeveloped by The Students Inc.CSE231 Summer Semester 2018Michigan State UniversityEast Lansing, MI 48824, USA.Pick a color: whiteYou are white and your opponent is black.Black always plays first.Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | b | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+d | | | | | | | | | +---+---+---+---+---+---+---+---+e | | | | | | | | | +---+---+---+---+---+---+---+---+f | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+g | | w | | w | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 12, White: 12Thinking ...black played (c6, d7).Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | b | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | | | b | +---+---+---+---+---+---+---+---+d | | | | | | | b | | +---+---+---+---+---+---+---+---+e | | | | | | | | | +---+---+---+---+---+---+---+---+f | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+g | | w | | w | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 12, White: 12[whites turn] :>In the above case, the human player chose to be white, so the AI picked black and played its first move (c6,d7). Thegame waits on a prompt that reads [whites turn] :>.Game Commands:In order to play the game, there is a set of commands that you are going to use (i.e. type at the prompt) --? exit: If you type exit on the prompt, the game will exit by showing the final outcome of the game, like this:[whites turn] :> exitCurrent board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | b | | b | | ...h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 12, White: 12This game ends in a draw.? pass: If you type pass, this will cause you to give up the game and admit defeat, no winning condition will bechecked.[whites turn] :> passCurrent board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | b | | b | | ...h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 12, White: 12white gave up! black is the winner!! yay!!!? move x y: This command will move a piece from position x to y, where x and y are diagonal to each other. Eachposition is denoted with a string board position like a2, c4 etc. Each pawn only can move forward diagonals.,but kings can move either forward or backward diagonals.[whites turn] :> move f7 e8white played (f7, e8).Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | b | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | | | b | +---+---+---+---+---+---+---+---+d | | | | | | | b | | +---+---+---+---+---+---+---+---+e | | | | | | | | w | +---+---+---+---+---+---+---+---+f | w | | w | | w | | | | +---+---+---+---+---+---+---+---+g | | w | | w | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 12, White: 12Invalid moves will trigger Exceptions accordingly –[whites turn] :> move e8 c6Error: Invalid move, please type hints to get suggestions.Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | ...[whites turn] :> move f3 e3Error: Invalid move, please type hints to get suggestions.Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | ...[whites turn] :> move f3 d5Error: Invalid move, please type hints to get suggestions.Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | ...? jump x y: This command will cause a piece to jump from position x to y, where x and y are diagonals that areone cell away. This command will be used to capture an opponent piece between the positions x and y.Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+d | | | | | | | | | +---+---+---+---+---+---+---+---+e | | | | | | | | w | +---+---+---+---+---+---+---+---+f | w | | w | | b | | | | +---+---+---+---+---+---+---+---+g | | w | | w | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 12, White: 11[whites turn] :> jump g4 e6white played [g4, e6].Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+d | | | | | | | | | +---+---+---+---+---+---+---+---+e | | | | | | w | | w | +---+---+---+---+---+---+---+---+f | w | | w | | | | | | +---+---+---+---+---+---+---+---+g | | w | | | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 11, White: 11This command will also display similar message on the event of an invalid jump.? hints: If you type this command it’s going to show the moves or jumps that you have on the board. If there arejumps, no move is allowed and hints will show them accordingly.[whites turn] :> hintsYou have moves:1: e6 d52: e6 d73: e8 d74: f1 e25: f3 e26: f3 e47: g6 f58: g6 f79: g8 f710: h3 g411: h5 g4Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | | | b | | b | ...[whites turn] :> hintsYou have captures:1: [g4, e6]2: [g6, e4]Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | ...? apply n: when you type hints, it’s going to show you the available m number of moves (or jumps) numbered from1. If you type apply n then n-th move (or jump) from the hints will be applied to the board.[whites turn] :> hintsYou have captures:1: [g4, e6]2: [g6, e4]Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+d | | | | | | | | | +---+---+---+---+---+---+---+---+e | | | | | | | | w | +---+---+---+---+---+---+---+---+f | w | | w | | b | | | | +---+---+---+---+---+---+---+---+g | | w | | w | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 12, White: 11[whites turn] :> apply 1white played [g4, e6].Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+b | b | | b | | | | b | | +---+---+---+---+---+---+---+---+c | | b | | b | | b | | b | +---+---+---+---+---+---+---+---+d | | | | | | | | | +---+---+---+---+---+---+---+---+e | | | | | | w | | w | +---+---+---+---+---+---+---+---+f | w | | w | | | | | | +---+---+---+---+---+---+---+---+g | | w | | | | w | | w | +---+---+---+---+---+---+---+---+h | w | | w | | w | | w | | +---+---+---+---+---+---+---+---+ Black: 11, White: 11When the game finishes, the program will end the game by declaring the winner with the difference in the number of piececount –[whites turn] :> white played (f1, e2).Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | | | | | | | b | +---+---+---+---+---+---+---+---+b | b | | | | | | b | | +---+---+---+---+---+---+---+---+c | | | | | | b | | | +---+---+---+---+---+---+---+---+d | B | | b | | | | | | +---+---+---+---+---+---+---+---+e | | w | | | | b | | | +---+---+---+---+---+---+---+---+f | | | | | | | | | +---+---+---+---+---+---+---+---+g | | | | | | | | | +---+---+---+---+---+---+---+---+h | B | | | | B | | | | +---+---+---+---+---+---+---+---+ Black: 9, White: 1Thinking ...black played [d1, f3].Current board: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | | | | | | | b | +---+---+---+---+---+---+---+---+b | b | | | | | | b | | +---+---+---+---+---+---+---+---+c | | | | | | b | | |代写CSE231留学生作业、代做Python编程语言作业、代写AI作业、代做Python课程设计作业 帮做C/C++编程 +---+---+---+---+---+---+---+---+d | | | b | | | | | | +---+---+---+---+---+---+---+---+e | | | | | | b | | | +---+---+---+---+---+---+---+---+f | | | B | | | | | | +---+---+---+---+---+---+---+---+g | | | | | | | | | +---+---+---+---+---+---+---+---+h | B | | | | B | | | | +---+---+---+---+---+---+---+---+ Black: 9, White: 0black wins by 9! yay!!Project Specifications – proj10.py and tools.py files:You need to complete the functions in the proj10.py file (along with code and function headers and comments), where allthe game-play logic and mechanisms will emulate the steps described previously. The last function, game_play_ai() willuse all the functions to implement the game-play. This is the function that we are going to test.Also, there is another file called tools.py which includes couple of difficult functions (finding all capturing paths, findingsingle move/jump positions etc.) that have already written for you. You need to import this module and use those functionsaccordingly in your implementation. The set of functions that you need to complete are as follows:1. def indexify(position):This function converts the letter-number position to row-column indices. The input position is a string like a1, h8 etc.The tuple returned is based on a design that has (row, column) pairs that start at (0,0) in the upper left corner. For example,for an 8x8 board:if the input is a1 then it will return a tuple (0,0)if the input is a2 then it will return a tuple (0,1)..if the input is e4 then it will return a tuple (4,3) and so on …Hint: This function does not check if the input is a valid position. This function should not have more than a line or two.Consider creating a mapping of letters to numbers with a dictionary. Also, the numeric positions start from 0, not 1.2. def deindexify(row, col):This function does the exact opposite of indexify(). In this case, the input is row and column values and it returns stringslike a1, h8 etc. For example, for an 8x8 board:if the input is 0,0 then it will return a string a1if the input is 0,1 then it will return a string a2..if the input is 4,3 then it will return a string e4 and so on …Hint: This function does not check if the input is a valid position. This function should not have more than a line or two.Consider creating a mapping of numbers to letters with a dictionary. Also, the numeric positions start from 0, not 1.3. def initialize(board):We provide this function. This function puts white and black pieces according to the checkers game positions. The blackpieces will be on the top three rows and the white pieces will be on the bottom three rows (for an 8x8 board). The first rowfor the black pieces will be placed as a2, a4, a6, ... etc. and the next rows will be b1, b3, b5, ... etc. For thewhite rows, the placement patterns will be opposite of those of blacks. This function must work for any even length boardsize.4. def count_pieces(board):Counts the total number of black and white pieces currently on the board. The counts will be returned as a tuple where thecount of the black will come first. For example, if black count is 10 and white count is 15, then it will return a tuple of ints(10,15).5. def get_all_moves(board, color, is_sorted = False):This function calls the get_moves(board, row, col, is_sorted = False) function (given in the tools.pyfile) to get moves for all the colored pieces on the board indicated by the color variable (color is a string, either ‘black’or ‘white’). This function returns a list of tuples where each tuple is a pair of string positions, e.g. (a1,c3). Thefirst item (i.e. a1) is the position of the current piece and the second item is the move that the piece at the first position canmake. A tuple (a1,c3) means the piece of color color at position a1 can move to the position c3. Obviously,this function goes over each piece in the board and list all the moves as a list of tuple as described. If the is_sorted valueis True then the final list must be sorted alphabetically by the first item in each tuple, then sorted by the second item (defaultsorting works). Note that this function returns “moves”, not “captures”—a different function returns “captures.” For example,in the example board of Figure 1: 1 2 3 4 5 6 7 8 +---+---+---+---+---+---+---+---+a | | | | | | | | W | +---+---+---+---+---+---+---+---+b | | | W | | W | | | | +---+---+---+---+---+---+---+---+c | | | | | | b | | b | +---+---+---+---+---+---+---+---+d | w | | w | | | | b | | +---+---+---+---+---+---+---+---+e | | | | b | | b | | w | +---+---+---+---+---+---+---+---+f | w | | w | | | | | | +---+---+---+---+---+---+---+---+g | | | | w | | w | | w | +---+---+---+---+---+---+---+---+h | w | | | | | | | | +---+---+---+---+---+---+---+---+Figure 1: An example board configurationIf we call get_all_moves(board, black, True), then this function will return this list of moves –[(c6, d5), (e4, f5), (e6, f5), (e6, f7)]In the example above, each move is collected by calling get_moves() function. For example, the last two moves (i.e.(e6,f5) and (e6,f7)) came from calling get_moves() at position e6, so get_moves(board, 4, 5, True) will return this list:[f5, f7]6. def apply_move(board, move):This function applies a move on the board, the variable move is a tuple of two positions as described previously. For example,if we want to apply the move (e6, f5) as found from the get_moves() function on the same board, we call thisfunction as apply_move(board, (e6, f5)). Then this function will move the piece from e6 to f5. Basically,it takes a reference to the piece at e6 and places it at f5 and then removes the piece at e6. This function must raise anexception if the movement is not valid. You can check the validity by verifying if the position at move[1] is already in thelist found from the get_moves() function. Also, if a movement yields a board position on the kings row, then the piecewill turn into a king (use the turn_king() function in the Piece class).7. def sort_captures(all_captures,is_sorted=False):We provide this function. If is_sorted flag is True then the final list will be sorted by the length of each sub-list and the sublistswith the same length will be sorted again with respect to the first item in corresponding the sub-list, alphabetically.8. def get_all_captures(board, color, is_sorted = False):This function goes over the whole board cell by cell and for each piece with the given color, this function finds the set ofcaptures that can be made by each piece and returns them in a list. This function calls the get_captures(board, row,col, is_sorted = False) function given in the tools.py file. For a given position (row, col), theget_captures() function returns a list of all possible capture paths starting at that (row, col) position. For example, ifwe call get_captures(board, 5, 2, True) (piece w at position f3 in the Figure 1) then we will get this list –[f3, d5, b7]This is a capture path. This means the piece w at f3 can jump to d5 and then jump to b7 to capture two b pieces.Therefore, this function returns a list of lists of captures found from get_captures() function for each piece on the board.For example, if there are 3 black pieces on the board and each of them has capture paths of length 2, then the final list returnedby get_all_captures() function will have a length of 3 * 2 = 6. For example, if we call this function on the board givenin the Figure 1, e.g. get_all_captures(board, white, True) then we will get this list:[[f3, d5, b7]]because in the whole board only the white piece at f3 can capture opponent’s pieces. Use the same is_sorted flag whenyou call get_captures(). If the is_sorted flag is True then the final list will be sorted by the length of each sub-listand the sub-lists with the same length will be sorted again with respect to the first item in corresponding the sub-list,alphabetically—we provide the function sort_captures() to do this sorting.9. def apply_capture(board, capture_path):This function applies a capture on the board. The variable capture_path is a list of jump positions, that can be found fromthe get_captures() function described previously. For example, if we want to apply a capture path like [‘f3’, ‘d5’,‘b7’] on the board in the Figure 1, we call this function as apply_capture(board, [‘f3’, ‘d5’, ‘b7’]).Then this function will move the piece from f3 to d5, then from d5 to b7. Also, during these consecutive movements, thisfunction will remove the opponent pieces from e4 and c6. This function must raise an exception if one of the jumpingpositions is not valid. This can be easily checked against the list found by calling the get_jumps() function given intools.py. More specifically, if we imagine the capture_path as series of positions like [p1, p2, p3, …, pn-1,pn], and if we are at a position pi, we will just check if the immediate next position pi+1 is in the list found fromget_jumps(board, rowpi, colpi, False) function call.10. def get_hints(board, color, is_sorted = False):This function returns hints on the next valid moves or jumps (captures). It returns a tuple of two lists for all pieces on theboard with given color – (list of all possible moves, list of all possible jumps). If there arejumps, then the first list will be empty. Both can be empty lists if there is neither any move nor jump. For example, if we callthis function for the board given in the Figure 1 as get_hints(board, white, True), it will return this tuple –([], [[f3, d5, b7]])The first list is empty because white must not make any move except jumps since it has at least one jump.11. def get_winner(board, is_sorted = False):Gets the current winner. The winner is decided as follows:(a) If black still has moves or captures but white does not, then black is the winner, returns black. Irrespective ofthe piece count.(b) If white still has moves or captures but black does not, then white is the winner, returns white. Irrespective ofthe piece count.(c) If (a) or (b) does not hold, then if there is only one black and one white piece on the board and if both are kings, thenreturns draw.(d) If (a), (b) or (c) does not hold, returns black if the total number of black pieces is more than that of white piecesand vice-versa, otherwise returns draw.Use the count_pieces() and get_hints() function here, pass the is_sorted flag to get_hints().11. def is_game_finished(board, is_sorted = False):This function returns a Boolean True/False. A game is finished when either black or white has no moves/captures. Useget_hints() function here. (This function can be done in a few lines, as few as 3 lines.)12. def game_play_human():This function implements the main game-play mechanism by stitching up all the functions that have been written so far. Thisfunction is already completed but you need to follow this code to write another function called game_play_ai().12. def game_play_ai():You need to complete this function using the help from the game_play_human() function. In game_play_human()both black and white moves are provided by a human. In this function, instead of getting all moves from a human, the humanprovides moves for one color, but moves for the other color come from a call to the AI functions to get the next move. Thegame AI is implemented in the gameai.py module.How to use the AI module to get the next move?In the gameai.py, module there is a function called get_next_move(board, turn), where turn is a colorstring like black or white. Please open the gameai.py file and locate the function. Given a board anda color, the get_next_move() will return the best move, like this:move = gameai.get_next_move(board, turn)The move can be either a move like (e6,f5’) or a jump sequence like [f3, d5, b7]. The AImodule depends on the functions that you are going to write, the AI will not work if your project code isincomplete. Specifically, the AI code depends on get_hints(), apply_move() and apply_capture()functions.Hint: only a few lines differ between the game_play_human() and the game_play_ai(). Basically, you need todecide if you are prompting the human player for a move or, if it is the other color’s turn, calling thegameai.get_next_move() function shown above to get the move. Because gameai.get_next_move() returnseither a move tuple or jump-sequence list, you will need to build an appropriate command (like the string provided by ahuman). I copied the game_play_human() function and added 8 lines to create game_play_ai()Important: before submission for testing you need to fix main to play the AI version rather than the human version.More tips:The file examples.py includes a set of example board configurations, use them to test the different edge cases for yourfunctions.Deliverables:The deliverable for this assignment is the following file:proj10.py – the source code for your Python programBe sure to use the specified file name and to submit it for grading via the Mimir system before the project deadline.Sample game-play outputs and Mimir tests:The mimir system will test all the functions specified in this project description. Mimir will also test a game-play examplespecified in play.in by comparing them with the play.out. There is also a hidden test whose input/output will not beprovided to the students. You are strongly recommended to read the example game-play outputs in play.out file.They can be opened with notepad/wordpad or text-editor on Mac.Grading Rubric:The most part of the project will be graded by mimirs automated tests and the score allocations are done as follows:General Requirements:( 3 pts) Coding standard 1-9, see the cse231 course web page.Implementations:( 4 pts) indexify() and deindexify() tests( 3 pts) count_pieces() test( 5 pts) get_all_moves() test( 5 pts) apply_move() test, must throw RuntimeError Two tests: one without exceptions; one with( 4 pts) get_all_captures() test( 7 pts) apply_capture() test, must throw a RuntimeError( 3 pts) get_hints() test( 5 pts) get_winner() test( 3 pts) is_game_finished() test( 8 pts) game_play_ai() test (test with play.in and play.out files)( 5 pts) hidden Test转自:http://ass.3daixie.com/2018112991356338.html

你可能感兴趣的:(讲解:CSE231、Python、AI、PythonC/C++|Matlab)