Using lists and custom-defined functions, this program calculates the coordinate positions of two turtles from a square array of eight turtles and swaps their positions.