mr.nick has asked for the wisdom of the Perl Monks concerning the following question:
All the questions of "Here is a problem, write a solution" bouncing around here recently has reminded me of the first programming competition I competed at, at Duke University way-back in '87.
I've tried to remember some of the problems we were presented and so far have only remembered one:
Write a program that outputs:
Now, granted this isn't of the same level as Masem's (Golf) Shortest Graph Distance by any stretch, but it's brings back memories.* *** ***** ******* ***** *** *
So, what's the shortest you can get the solution in Perl? Mine is at 51 currently (strict & -w safe):
for(0..3,2,1,0){print" "x(3-$_),"*"x($_*2+1),"\n"}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Programming Contest (High School '87)
by no_slogan (Deacon) on May 12, 2001 at 03:37 UTC | |
by tilly (Archbishop) on May 12, 2001 at 14:44 UTC | |
Re: Programming Contest (High School '87)
by MrNobo1024 (Hermit) on May 12, 2001 at 03:21 UTC | |
Re: Programming Contest (High School '87)
by Kanji (Parson) on May 12, 2001 at 03:31 UTC | |
Re: Programming Contest (High School '87)
by MeowChow (Vicar) on May 12, 2001 at 06:00 UTC | |
(Ovid) Re: Programming Contest (High School '87)
by Ovid (Cardinal) on May 12, 2001 at 03:32 UTC | |
Re: Programming Contest (High School '87)
by perlmonkey (Hermit) on May 12, 2001 at 05:15 UTC | |
by clintp (Curate) on May 12, 2001 at 05:31 UTC | |
by dws (Chancellor) on May 12, 2001 at 05:27 UTC | |
Re: Programming Contest (High School '87)
by damian1301 (Curate) on May 12, 2001 at 09:29 UTC |
Back to
Seekers of Perl Wisdom