Recent Bring Your Own Code
The goal of BYOC is simple: provide an outlet for you, the enquiring software developer, to sharpen your programming skills on a problem a bit more interesting than the normal, boring stuff. That, and to put your code where you mouth is, so to say.
Kirkman's Ladies
by Alex Papadimoulis
in Bring Your Own Code
on 2009-09-16
Well over 150 years ago, the Reverend Thomas Kirkman posed an interesting problem in The Ladies' and Gentlemen's Diary for 1850. The curiously-named publication was in fact a mathematical journal and, as such, Kirkman's problem was mathematical in nature.
Fifteen young ladies in a school walk out three abreast for seven days in succession: it is required to arrange them daily so that no two shall walk twice abreast.
Sliding Around
by Alex Papadimoulis
in Bring Your Own Code
on 2009-09-02
Andy Hertzfeld is a bona fide Software Wizard. I'm not kidding: it was his official job title, codified on his business card. And not just any old business card, but one from Apple Computer. You see, not only was Andy a key player on the Macintosh team, but he also had a knack for doing the impossible. One his feats was described in the September 1995 issue of Byte Magazine.
Besides everything else he did to help get the first Macintosh out the door, Andy Hertzfeld wrote all the first desk accessories. Most of these were written in assembly. However, to show that desk accessories could also be written in higher-level languages, Hertzfeld wrote a demonstration puzzle games desk accessory in Pascal. Like its plastic counterparts, users moved squares around until the numbers 1 to 9 were in order. As time began to get short, the decision was made that the puzzle, at 7KB [7KB = 7168 bytes], was too big (and too game-like) to ship with the first Macintosh. In a single weekend, Hertzfeld rewrote the program to take up only 800 bytes. The puzzle shipped with the Mac.
That's pretty impressive, especially considering that simply telling the story took a little under 800 bytes. Fortunately, Andy did have one thing going for him: sliding puzzles — especially of the 32 variety — are pretty simple. There are nine squares and eight pieces, and a piece can slide into the empty square.