Skip to main content
deleted 23 characters in body
Source Link
Ventero
  • 10.1k
  • 3
  • 24
  • 55

Golfscript, 27 characters

" "9*"*"9,{n\.4$>\.+)"0"*}%

The resulting tree looks like this:

         *
         0
        000
       00000
      0000000
     000000000
    00000000000
   0000000000000
  000000000000000
 00000000000000000

A version which uses the height parameter only once is one character longer:

9." "*"*"@,{n\.4$>\.+)"0"*}%

And to readReading the height from stdin (with input "10" to generate the example tree), we have to use one additional character for a total takes the same amount of 29characters (28):

~(.,)" "*"*"@,{n\.4$>\.+)"0"*}%

Golfscript, 27 characters

" "9*"*"9,{n\.4$>\.+)"0"*}%

The resulting tree looks like this:

         *
         0
        000
       00000
      0000000
     000000000
    00000000000
   0000000000000
  000000000000000
 00000000000000000

A version which uses the height parameter only once is one character longer:

9." "*"*"@,{n\.4$>\.+)"0"*}%

And to read the height from stdin (with input "10" to generate the example tree), we have to use one additional character for a total of 29:

~(." "*"*"@,{n\.4$>\.+)"0"*}%

Golfscript, 27 characters

" "9*"*"9,{n\.4$>\.+)"0"*}%

The resulting tree looks like this:

         *
         0
        000
       00000
      0000000
     000000000
    00000000000
   0000000000000
  000000000000000
 00000000000000000

A version which uses the height parameter only once is one character longer:

9." "*"*"@,{n\.4$>\.+)"0"*}%

Reading the height from stdin (with input "10" to generate the example tree) takes the same amount of characters (28):

~,)" "*"*"@{n\.4$>\.+)"0"*}%
Source Link
Ventero
  • 10.1k
  • 3
  • 24
  • 55

Golfscript, 27 characters

" "9*"*"9,{n\.4$>\.+)"0"*}%

The resulting tree looks like this:

         *
         0
        000
       00000
      0000000
     000000000
    00000000000
   0000000000000
  000000000000000
 00000000000000000

A version which uses the height parameter only once is one character longer:

9." "*"*"@,{n\.4$>\.+)"0"*}%

And to read the height from stdin (with input "10" to generate the example tree), we have to use one additional character for a total of 29:

~(." "*"*"@,{n\.4$>\.+)"0"*}%