Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Initialize data structure with required variables. Throws an error on incorrect value ranges and types given
@type piece: character @param piece: The piece to be moved @type right: integer @param right: If the piece should be to the right by a space @type up: integer @param up: If the piece should be moved up by a space """
""" Ensure that the move is valid for the board and the piece is a character. """ # first check if the type of piece is a character and the # direction of the move is horizontal or vertical and not # diagnol ((self.up != 0 and self.right == 0) or \ (self.up != 0 and self.right == 0) or \ (self.up == 0 and self.right != 0) or \ (self.up == 0 and self.right != 0))
""" Test whether the two moves are equal.
@type move: Move @param move: Move being tested for equality @rtype: boolean @return: Whether the two moves are equal """
""" Convert self to string.
@rtype: str @return: String representation of the move """
""" Instantiate a move that will go left
@type piece: character @param piece: Character that represents the piece to be moved """
""" Instantiate a move that will go right
@type piece: character @param piece: Character that represents the piece to be moved """
""" Instantiate a move that will go up
@type piece: character @param piece: Character that represents the piece to be moved """
""" Instantiate a move that will go down
@type piece: character @param piece: Character that represents the piece to be moved """ |