import objectdraw.*; import java.awt.*; public class Magic extends WindowController{ private static final int ODDSIZE = 3; //width/height of odd array private static final int EVENSIZE = 4; //width/height of odd array //The first number to add to the even magic square private static final int FIRSTEVENNUMBER = 9; private int[][] oddIntArray; // magic square with an odd number of cells private int[][] evenIntArray; // magic square with an even number of cells public void begin(){ //Create the arrays oddIntArray = new int[ODDSIZE][ODDSIZE]; evenIntArray = new int[EVENSIZE][EVENSIZE]; //initialize both arrays to have all -s setNegOnes(); //create a magic square with an odd number of squares createOdd(); //initialize the even magic square (to make the computation go faster) initEvenArray(); //fill in the even magic square (starting with number FIRSTEVENNUMBER) createEven(FIRSTEVENNUMBER); //Print out the squares to the Interactions panel printMagicSquares(); } //Initialize both arrays to have all -1's private void setNegOnes(){ //Set the odd array to have all negative ones for (int row=0; row