Question: python 3 A capture move, in which a player slides a piece along a straight line, around a circular track, and then further along a
python 3
A capture move, in which a player slides a piece along a straight line, around a circular track, and then further along a straight line, until it lands on an opposing piece, which is then removed from the board. Pieces making a capture move may move more than one intersection during such a move, but may not jump over other pieces. Note that a capture move must use at least one of the circular tracks, and may use more than one. Update:A capture move can start and/or end on the edge of the board; that is, it can move along a straight line of length zero!

Write a function make_move_capture(board_string, start, end) that takes as input a string representation of the current board state, a tuple representing the initial position of the piece to be moved (start), and a tuple representing the end position (end) the piece is to be moved to. This function will validate if the move is valid and if so, execute the move. The function should return a string representation of the board reflecting the position of the pieces after the move if the move is valid, or None if the move is invalid. Assumptions: Normal moves need not be considered for the purpose of this task (ie, they would be deemed invalid). >>> print(make_move_capture('xxxx........oooo', (0, 0), (0, 1))) None >>> print(make_move_capture('x.xx.x......oooo', (1, 1), (1, 3))) 'x.xx........oxoo'
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
