This will create a 4 by 4 magic square out of the variables for any number bigger than 33 (34 is the biggest without using 0 or negative numbers). Just tap space or the green flag to enter a new number.
I used a algorithm from Arthur Benjamin's book Think Like A Maths Genius