in reply to (Golf) Decorating the Christmas Tree
... so i had no choice but to cheat. =) the following satisfies the rules strictly speaking, but only uses '0' as a decoration. it's 91 chars (or 80 excluding the setting of $h and $f).($h,$f)=@_;for(1..$h){print' 'x($h-$_).($_==1?'*':join'',map{rand>$f?' +=':qw(* 0 @ +)[rand 4]}1..$_*2-1)."\n"}
of course japhy's entry could be modified similarly, thereby bringing us equal again.($h,$f)=@_;for(1..$h){print' 'x($h-$_).($_==1?'*':join'',map{rand>$f?' +=':0}1..$_*2-1)."\n"}
oh well, as they say, cheaters never win.
- danboo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (Golf) Decorating the Christmas Tree
by danboo (Beadle) on Dec 03, 2001 at 23:11 UTC | |
by japhy (Canon) on Dec 03, 2001 at 23:35 UTC | |
by Rhose (Priest) on Dec 03, 2001 at 23:56 UTC |