Code golf rewrite and testing tweak

Hi Crista, here's another version of the code golf, shorter than Peter's, although of course worse in other ways. I have no idea if it suits your purpose for these exercises; I was just playing around with it, and might as well share.

I also set the executable bit on Peter's source file and added a #! line so the test script would find it and run it without error.

BTW we met at PARC back in the 90s when I interviewed for the job Jim Hugunin ultimately took.

Regards,
Darius