here's a couple/three things,

Firstly, you can drop the extra $/'s being printed on yours by changing the 0..$a to 2..$a as shown in #1. The second thing i worked on was a one-liner version, which is #2. It weighs in at 71 characters. However, if i'm allowed to disregard numbers over 1000 (which would take more than 45 rows to get) i can drop that by three characters to 68 as shown in #3.

# 1 $n=length$a++*$a/2;map{map{printf" %$n.d",++$k}2..$_;print$/}2..$a # 2 print+(map$"x(length(($a+1)*$a/2)+1-length++$l).$l,2..$_),$/for 2..$a+ +1 # 3 print+(map$"x(($a>13?4:$a>3?3:2)-length++$l).$l,2..$_),$/for 2..$a+1
Anyway, thanks for the fun,
jynx


In reply to Re: (golf) Triangle of numbers by jynx
in thread (golf) Triangle of numbers by hopes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.