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"}
Back to
Seekers of Perl Wisdom