Saturday, January 17, 2009

All-star Max

Here's my stah for Max who deserves it for a variety of reasons. He is learning tiny-c, which is not easy. star.tc, when "fed" 15, says there are three unique 15-point stahs, a "skip-1," a "skip-3" and a "skip-6." Follow how his stah is drawn: start at point #1, skip the next 3 points to point #5, skip the next 3 points to point #9 etc. Eventually you arrive back at point #1. Not unlike "clock arithmetic," star.tc relies on the "modulus" operator (%) to figure out which skip numbers produce stahs. I called this poast "All-star Max" because 1. Max is an all-star on our team and 2. the number of unique stahs happens to be related to a famous function in math called the "totient function" which is used in totient.tc. A sample run of the allstars function that appears in this program may be viewed at allstars.txt.

No comments: