=for advent_year 2009 =for advent_day 2 =for advent_title New Winter Spectator Sport - Thongs & Toboggans =for advent_author Bill 'N1VUX' Ricker I have confessed previously to using Perl to cheat at the A. Some of my successes were not elegant, for instance my original solution for =begin quote Think of a familiar 9-letter word, in which the first letter immediately follows the D<9th> in the alphabet. The D<2nd> letter immediately follows the D<8th> in the alphabet. The D<3rd> immediately follows the D<7th>, and the D<4th> immediately follows the D<6th>. For example: SPECTATOR (S follows R, and P follows O). Unfortunately, the pattern breaks down with the remaining letters. Hint: The word is used most often in the TV and film industry. What word is it? -- D =end quote required explicit looping with D, looks like C or D. Modules such as M M and M N can modernize the code nicely. M provides C to alias the chars of the string, such that array elements assigned to change the string, so better than C< split ""> for some uses. The C forms are shorthand and in a C loop still aliases. Here I am using C to replace C< map {ord} split>. Likewise from C to replace explicit loop logic N. =begin pre 3 bethesda 4 offscreen 3 thongs 3 toboggans 3 tuffets 3 tumults =end pre =sourcedcode mod02.pl =begin footnote allu M combines M and M, though it's a bit of a misnomer because it excludes M. =end footnote =begin footnote slow Normally one expects implicit loops to be faster than C loops than C loops, but here the copying for reverse etc defeat the speed-up, it runs 2-3x slower. =end footnote