#!/usr/bin/perl my %Deer = ( Dasher => 'Now', Dancer => 'Now', Prancer => 'Now', Vixen => 'and', Comet => 'On', Cupid => 'On', Donder => 'On', Blitzen => 'and', Now => { Dasher => 'Dancer', Dancer => 'Prancer', Prancer => 'Vixen', 'and' => { Vixen => 'Comet' }, }, On => { Comet => 'Cupid', Cupid => 'Donder', Donder => 'Blitzen', 'and' => { Blitzen => 0 }, }, ); local $away; print dash('Dasher'), <DATA>; sub dash { my($deer, $from) = @_; return unless $deer; local $str; my $next; my $harness = $Deer{$deer}; unless ($harness eq 'and') { $next = $Deer{$Deer{$deer}}{$deer}; $harness .= ','; $harness = "! $harness" if $away; } else { $next = $Deer{$from}{$harness}{$deer}; $harness = " $harness"; } $str .= "$harness $deer"; $str .= "!\n" if $away; $away = !$away; $str . dash($next, $Deer{$deer}); } __DATA__ To the top of the porch! To the top of the wall! Now dash away! dash away! Dash away all!
P.S. Yes, Donder.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HoHoHo
by radiantmatrix (Parson) on Dec 02, 2004 at 21:15 UTC | |
by mojotoad (Monsignor) on Dec 03, 2004 at 06:26 UTC | |
by radiantmatrix (Parson) on Dec 03, 2004 at 15:00 UTC | |
|
Re: HoHoHo
by wolfger (Deacon) on Dec 02, 2004 at 16:45 UTC | |
|
Re: HoHoHo
by Anonymous Monk on Dec 02, 2004 at 10:54 UTC |