Finishing Touches

  1. Make the Is a magic square? block.
    There is more than one good way to write this code. After you've written Is a magic square? , see if anyone in the class has a method different from yours.
    green predicate: Is (square) a magic square?
    Here are some magic squares to test (from Getting Started):
    is 12,13,14,10,18,11,17,15,16 a magic square?
    is 80,10,60,30,50,70,40,90,20 a magic square?
    is 17,16,21,22,18,14,15,20,19 a magic square?
    is 10,10,10,10,10,10,10,10,10 a magic square?
Teacher Feedback: These TIF questions (especially toward the end) are way too hard for the HS level. The teacher who mentioned this said that when they did research on their own to answer these questions, they found that the prime magic square stuff has only even come out very recently. So, this is just way too much. We might need to think about an upper limit on difficultly for TIF problems. We want challenging stuff, but not over the top. --MF
  1. Build a magic square checker for 2-by-2 squares.
  2. ... for 4-by-4 squares.
  3. Tough StuffChallenge ... for n-by-n squares.
  4. Build a magic-square generator given a target sum as input.
  5. Tough StuffChallenge Find a 3-by-3 magic square made up entirely of prime numbers.