def convert_coordinates_wrapped_mode(coordinates: dict, width: int, height: int, gamemode: str) -> dict:
    """ Convert coordinates outside of board to inside if playing wrapped """
    if gamemode != "wrapped": return coordinates
    x, y = coordinates["x"], coordinates["y"]
    return {"x": x % width, "y": y % height}