Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: HOW CAN WE MAKE A TRIANGLE LIKE THIS IN PERL

by roboticus (Chancellor)
on Mar 26, 2013 at 11:00 UTC ( #1025499=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ cat t.pl
    #!/usr/bin/perl
    ...
        }
        print "\n";
    }
    
  2. or download this
    print "A bit more perlish: convert C-style for loops\n"
    .     "into perl style for loops\n";
    ...
        }
        print "\n";
    }
    
  3. or download this
    print "Yet more perlishiosness: use the for statement modifier\n";
    for my $i (reverse 1 .. $n) {
        print "*" for 0 .. $i;;
        print "\n";
    }
    
  4. or download this
    print "Not enough perlbell: use 'x' operator for inner loop\n";
    for my $i (reverse 1 .. $n) {
        print "*" x $i, "\n";
    }
    
  5. or download this
    print "Jumping the shark: adding some per(i)lousness\n";
    print map { "*" x $_, "\n" } reverse 1 .. $n;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025499]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (17)
As of 2015-07-31 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls