"Albrecht Durer had a square, ee-eye-ee-eye-oh!" -- not actually a children's song, but whatever.

A week or so ago in school, we were looking ahead (preview of coming attractions you know how it goes. or maybe you dont idk) to artists we would be researching over the next few weeks. One of them was Albrecht Durer, a Renaissance [s]painter[/s] [s]sketch artist[/s] [s]engraver[/s] guy who made metal engravings so he could mass reproduce his tremendously detailed work.

The upshot of this is that one of the pieces we were looking at was Melancholia I, which just happens to have a 4x4 magic square tucked away in the background. The teacher decided that we would spend the next fifteen minutes or so trying to find as many possible combinations of four numbers that square that add to 34 (the magic constant for Durer's square).

Me, being any partially sane teenage male with a calculator and some rudimentary knowledge on how to code in TI-BASIC, decided I would game the system. I created my first-ever original program, a very bad, slow, program that went through all 16^4 possible combinations of numbers in the square. It took almost fifteen minutes to run, but the actual coding was done within the given time frame (yay, me!). There was still a strange domain bug, but I fixed it later (during lunch).

The next day, I managed to convince my teacher to accept the Magic Square program as my project for Durer, in lieu of a "500-word essay comparing any two of [Durer's] pieces of art".

Yes, I hate physical pen-to-paper writing that much.

In any case, I soon published it to the Cemetech Archives -- you can find it here.

You can find the newer version here once it has been approved by the mods.

[s]I will also be publishing a second version that completely overhauls the guess-and-check system, and also increases speed by about a third.[/s] The second version has been published to the Archives and is pending approval as of 11/18/2021. There is one display bug, however -- if you can fix it, good on you. I am currently working on a third version (exports to a list), and a fourth version (graphical) that doesn't save the quadruplets, but rather draws them on the graph screen.

Have fun with this, and watch out for my next program. Which I may or may not have stayed up almost all of [s]last night[/s] Tuesday night finishing the first version of. (Shh... don't tell my mom)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement