text:
Print a sinusoidal wave (vertically)
Print a continuous sinusoidal wave scrolling vertically on a terminal. The program should not terminate and should continuously scroll down the wave (except until it is somehow interrupted). You may assume overflow is not a problem (i.e. you may use infinite loops with incrementing counters, or infinite recursion).
The wave should satisfy the following properties:

Amplitude = 20 chars (peak amplitude)
Period = 60 to 65 lines (inclusive)
The output should only consist of spaces, newline and |
After each line of output, pause for 50ms

Sample output:
                    |
                      |
                        |
                          |
                            |
                              |
                                |
                                 |
                                   |
                                    |
                                     |
                                      |
                                       |
                                        |
                                        |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                   |
                                  |
                                |
                               |
                             |
                           |
                         |
                       |
                     |
                   |
                 |
               |
             |
            |
          |
        |
       |
     |
    |
   |
  |
 |
 |
 |
 |
 |
 |
 |
  |
   |
    |
     |
      |
        |
         |
           |
             |
               |
                 |
                   |
                     |
                       |
                         |
                           |
                             |
                              |
                                |
                                  |
                                   |
                                    |
                                      |
                                      |
                                       |
                                        |
                                        |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                    |
                                   |
                                  |
                                |
                               |
                             |
                           |
                         |
                       |
                     |
                   |
                 |
               |
             |
           |
          |
        |
       |
     |
    |
   |
  |
 |
 |
 |
 |
 |
 |
 |
  |
   |
    |
     |
       |
        |
          |
            |
             |
               |
                 |
                   |

The above output should go on forever unless otherwise interrupted, e.g. SIGINT or SIGKILL, or closing terminal window, or you power off your machine, or the Sun swallows the Earth, etc.
Shortest code wins.
Note. I am aware of a similar problem on Display Scrolling Waves but this isn't exactly the same. In my problem, the wave is not to be scrolled "in place" - just output it on a terminal. Also, this is an ascii-art problem, so don't use Mathematica to plot it.

Peak amplitude, peak-to-peak amplitude, or root-square amplitude?

Peak amplitude.

@David The Ecuador makes it pretty obvious. :-P

Is it ok to draw a wave with just |s and no spaces?

@Gelatin Yes it is ok.

Can a specific standard terminal width be assumed (e.g. 80)?

@maxwellb Terminal width is unspecified, i.e. do whatever you want :)

@ace Wait, if I were to replace every space character in your sample output with |, it would be a valid program? You shouldn't say this because it changes the question.

@Quincunx it's not a wave then, is it?

@ace Then why your response to this?

@Quincunx Oh... I thought using no spaces mean something like printf("%*c")... sorry for the misunderstanding...

All answers yet are invalid. They also stop for SIGKILL not just for SIGINT.

@Max Ried fine, I will change it to "should go on forever unless otherwise interrupted".

...or the Sun swallows the Earth, or the galaxy suffers from heat death, or highly intelligent beings tamper with the space time continuum

APL (35)
(Yes, it does fit in 35 bytes, here's a 1-byte APL encoding)
{∇⍵+⌈⎕DL.05⊣⎕←'|'↑⍨-21+⌈20×1○⍵×.1}1

Explanation:

{...}1: call the function with 1 at the beginning
1○⍵×.1: close enough for government work to sin(⍵×π÷30). (1○ is sin).
-21+⌈20: normalize to the range 1..40 and negate
'|'↑⍨: take the last N characters from the string '|' (which results in a string of spaces with a | at the end
⎕←: display
⌈⎕DL.05: wait 50 ms and return 1. (⎕DL returns the amount of time it actually waited, which is going to be close to 0.05, rounding that value up gives 1).
∇⍵+: add that number (1) to ⍵ and run the function again.

Darn... I thought trigonometric functions plus the time delay would leave you guys out

Here a 33 char one: {⎕←'|'↑⍨-⌈20×1+1○⍵⋄∇.1+⍵⊣⎕DL.05}0

@ace LOL. You should check APL out, it's not a novelty language. It's very old and has been in use in large systems for decades. It's quite unique, compared to anything else. IMHO the symbols make it much more readable that the ASCII-only derivatives (J)

C, 74 73 70 69 67 characters
67 character solution with many good ideas from @ugoren & others:
i;main(j){main(poll(printf("%*c|\n",j=21+sin(i++*.1)*20,0),0,50));}

69 character solution with while loop instead of recursion:
i;main(j){while(printf("%*c|\n",j=21+sin(i++*.1)*20,0))poll(0,0,50);}

Approaching perl territory. :)

This was inspired by @ace's own C answer.

I think you could use 5E4 instead of 50000.

I think you could use *.1 instead of /10.

@musiphil, I also thought about using 5E4, but it turns out that it does not work: Without showing the compiler usleep() prototype, you would have to explicitly cast the 5E4.

@moala, thanks! Using *.1 instead of /10 seems to work.

@treamur: Thanks for the info. I also considered the possibility of a type error, but pre-ISO C was so archaic that I couldn't figure out the rules exactly. :)

You can cut out two more characters by moving the assignment to j into the printf, like this: printf("%*s\n",j=21+sin(i++*.1)*20,"|"). The resulting type is still int so it's a valid field width argument.

One more character by replacing usleep(50000); with poll(0,0,50);.

"%*s", where have you been all my life? +1 just for that.

@Art, totally awesome, thanks! Implemented both of your ideas. I had been thinking of poll() myself, but I mistakenly landed my eyes on ppoll() parameter list on the manual page, so I discarded the idea. I was too hasty. Very nice that you brought the idea up again. :)

main(poll(!printf(...),0,50)); saves a character.

@ugoren, totally so! Thank you for the tip. :)

@treamur - Two ugly ideas - 1. Omit ! (with 0 FDs, poll doesn't use the pointer). 2. Use %*c| with 0 (prints invisible NUL characters).

@ugoren, brilliant ideas again, thanks! I added them to the answer.

Mathematica 121 104 80 67 64
n=1;While[0<1,Spacer[70 Sin[n Pi/32]+70]~Print~"|";Pause@.05; n++]

question says not to use mathematica to plot it.  is this different than that somehow?

@Malachi Yes. This uses mathematica to calculate it, just like any other answer. Using mathematica to plot would be telling mathematica to plot x=20*sin(pi*y/30)+20 or something similar.

ok I get what you are saying thank you for the clarification

Clever rule-bending :)

+1, but as written you have 75 chars including whitespace. And  n=1;While[1==1,Spacer[70 Sin[n Pi/32]+70]~Print~"|";Pause@.05;n++] is 66 chars.

And here is a 58 char version Do[Spacer[70*Sin[n*Pi/32]+70]~Print~"|";Pause@.05,{n,18!}]

Im not a Mathematica user, but i think you can change 1 == 1 to 0 < 1 to decrease 1 char.

@CCP 2   Yes, you are correct! Thanks.

Perl, 48 (68)
GNU sleep version: 48
print$"x(25+20*sin).'|
';$_+=.1;`sleep .05`;do$0

Cross platform: 68
use Time::HiRes"sleep";print$"x(25+20*sin).'|
';$_+=.1;sleep.05;do$0

Removed the use of Time::HiRes module by using shell sleep function.
Shortened increment as per Ruby example.
Shortened using $" and $0 seeing hints from Primo's work
Thanks for hints Primo.

I saved this as a file test.pl and ran perl ./test.pl, however the waiting time does not match the specification. Also, the amplitude of the wave is too small. (This amplitude refers to the length between the peak and the equilibrium position.)

I guess if I changed the increment from .105 to .1 I would beat ruby at 56 chars!

@primo - my shell sleep does do times shorter than 1 second...

man sleep → unsigned int sleep(unsigned int seconds);. It won't error, but the actual sleep interval is zero. Some suggestions to make yours shorter: change $d to $_, and then use (25+20*sin), and change the \n for a literal newline.

@primo man 1 sleep on a GNU/Linux bash shell tells us that Unlike most  implementations  that require NUMBER be an integer, here NUMBER may be an arbitrary floating point number.

@ace good to know.

I left the GNU sleep version running on my PC over the weekend. I thought you might like to know that it leaked 5GB memory

Shocking news!!! I guess the do$0 is the culprit. But it saves a byte instead of putting it in a block and calling redo at the end of the block...

Perl - 64 (or 60) bytes
The following uses a Windows-specific shell command:
`sleep/m50`,print$"x(20.5-$_*(32-abs)/12.8),'|
'for-32..31;do$0

The following uses a GNU/Linux-specific shell command:
`sleep .05`,print$"x(20.5-$_*(32-abs)/12.8),'|
'for-32..31;do$0

Both at 64 bytes.

Period is 64.
Maximum amplitude is exactly 20.
The curve is perfectly symmetric.
Every period is identical.

                    |
                      |
                         |
                           |
                             |
                               |
                                |
                                  |
                                   |
                                    |
                                     |
                                      |
                                       |
                                       |
                                        |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                    |
                                   |
                                  |
                                |
                               |
                             |
                           |
                         |
                      |
                    |
                  |
               |
             |
           |
         |
        |
      |
     |
    |
   |
  |
 |
 |
|
|
|
|
|
 |
 |
  |
   |
    |
     |
      |
        |
         |
           |
             |
               |
                  |
                    |
                      |
                         |
                           |
                             |
                               |
                                |
                                  |
                                   |
                                    |
                                     |
                                      |
                                       |
                                       |
                                        |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                    |
                                   |
                                  |
                                |
                               |
                             |
                           |
                         |
                      |
                    |
                  |
               |
             |
           |
         |
        |
      |
     |
    |
   |
  |
 |
 |
|
|
|
|
|
 |
 |
  |
   |
    |
     |
      |
        |
         |
           |
             |
               |
                  |
                    |
Note that this isn't exactly a sinusoidal wave, but rather a quadratic interpolation. Plotted against an actual sin:

At the granularity required, these are visually indistinguishable.
If the aesthetics aren't so important, I offer a 60 byte alternative, with period length 62, maximum amplitude of ~20.02, and slight asymmetries:
`sleep/m50`,print$"x(20-$_*(31-abs)/12),'|
'for-31..30;do$0

This isn't a sinusoidal wave; it is simply parabolas (if I read your code right). (If you can represent this with some sinusoidal wave, I'd love to see the function).

Sine is a formula, if you replicate the formula it is still a Sinusoidal wave. and this is probably a variant of Sine in some fashion.

Ruby 56
i=0
loop{puts" "*(20*Math.sin(i+=0.1)+20)+?|;sleep 0.05}

Is replacing puts with p allowed?

@Slicedpan I think I won't, since this is a challenge to draw something. p will add double quotes around around each line and alter the "drawing".

Befunge 98 - 103 100
:1g:02p' \k:02gk,'|,a,$ff*:*8*kz1+:'<\`*
468:<=?ABDEFGGGHGGGFEDBA?=<:86420.,+)'&$#"!!! !!!"#$&')+,.02

Cheers for a program that does this, in a language without trigonometric capabilities; the first program in fact. The second line is simply data; the character corresponding with the ascii value of the sin, added to a space character.
EDIT: I saved 3 chars by not subtracting the space away; the sinusoid is translated 32 units to the right (which is valid).
Befunge also does not have a sleep command, or something similar. It would be nice to find a fingerprint, but I couldn't find one, so ff*:*8* pushes 8*225**2 (405000) and kz runs a noop that many times (well, that many times + 1). On windows command line with pyfunge, this turns out to be about 50 milliseconds, so I say I'm good. Note: if anyone knows a good fingerprint for this, please let me know.
The last part of the code simply checks if the counter (for the data line) is past the data, if it is, the the counter is reset to 0.
I used this to generate the data.

Taylor Series
Although this version is 105 chars, I just had to include it:
:::f`!4*jf2*-:::*:*9*\:*aa*:*:01p*-01g9*/a2*+\$\f`!4*j01-*b2*+:01p' \k:01gk,$'|,a,ff*:*8*kz1+:f3*`!3*j$e-

I was trying to shorten my program, and decided to look at the taylor series for cosine (sine is harder to calculate). I changed x to pi * x / 30 to match the period requested here, then multiplied by 20 to match the amplitude. I made some simplifications (adjusted factors for canceling, without changing the value of the function by much). Then I implemented it. Sadly, it is not a shorter implementation.
:f`!4*jf2*-

checks whether the values of the taylor series are getting inaccurate (about x = 15). If they are, then I compute the taylor series for x - 30 instead of x.
:::*:*9*\:*aa*:*:01p*-01g9*/a2*+

is my implementation of the taylor series at x = 0, when x is the value on the stack.
\$\f`!4*j01-*

negates the value of the taylor series if the taylor series needed adjustment.
b2*+

make the cosine wave positive; otherwise, the printing would not work.
:01p' \k:01gk,$'|,a,

prints the wave
ff*:*8*kz1+

makeshift wait for 50 milliseconds, then increment x
:f3*`!3*j$e-

If x is greater than 45, change it to -14 (again, taylor series error adjustment).

This is exactly the kind of answer I'm looking forward to, hope you can golf it down :)

There! I successfully decreased the code length by -5 chars! And there is still room for improvement!

@Quincunx my perl solution also does not use any built in trig functions ;)

Python, 108,93,90,89,88
import math,time
a=0
while 1:print" "*int(20+20*math.sin(a))+"|";time.sleep(.05);a+=.1

Now with infinite scrolling :)
Edit: ok, 90. Enough?
Edit:Edit: no, 89.
Edit:Edit:Edit: 88 thanks to boothby.

Sorry if I haven't made the question clear - your program should not terminate and should continuously scroll down the wave (except until SIGINT)

a=0. -> a=0 gets you to 88

PHP, 59 characters
<?for(;;usleep(5e4))echo str_pad('',22+20*sin($a+=.1)).~ƒõ;

You can save yourself some bytes by using echo ...; in place of fwrite(STDOUT,...);.

That makes sense when calling from the command line anyway. 10 characters saved - thanks primo.

58: <?for(;;)echo~str_pad(ƒõ,22+20*sin($a+=.1),ß,usleep(5e4));

Very nice. I won't edit my answer with those changes, you should post as your own.

Is this verified to work? It doesn't work on http://ideone.com/6gmtfl , nor does it work on my computer. (Although it does print a sine wave with the error message)

@ace it needs to be saved with an ansi encoding. ideone automatically converts everything to utf-8, which breaks. ~ƒõ is just shorthand for "|\n".

@AlexBarrett the difference isn't significant enough to warrent a separate answer. I just like to see PHP do well. If you prefer, you can add it to your own as "a 58 byte variant suggested by primo" or some such ;)

C64 BASIC, 64 PETSCII chars

On a PAL C64, For i=0 to 2:next i cycles for approx. 0,05 seconds, so the delay time is respected.

C - 86+3 characters
Thanks shiona and Josh for the edit
i;main(j){for(;j++<21+sin(i*.1)*20;)putchar(32);puts("|");usleep(50000);i++;main(1);}

i;main(j){for(j=0;j++<20+sin(i/10.)*20;)putchar(32);puts("|");usleep(50000);i++;main();}
float i;main(j){for(j=0;j++<20+sin(i)*20;)putchar(32);puts("|");usleep(50000);i+=.1;main();}

Compiled with the -lm flag, I assume I need to add 3 chars

Would it work if you made i an int and just divided it by 10.0 (or 9.9 to save a char?) within the call to sin()? i;main(j){for(j=0;j++<20+sin(i/10.0)*20;)putchar(32);puts("|");usleep(50000);i++;main();}

You can bring the size down to 76 characters or so by using printf() to replace the for loop: printf("%*s\n",(int)(21+sin(i++/10.)*20),"|")

Hmm... I would feel really guilty if I use this idea in my answer, especially when this is my own question... Would you consider posting an answer yourself?

You can shave off two more characters if you remove the j=0:
i;main(j){for(;j++<21+sin(i/10.)*20;)putchar(32);puts("|");usleep(50000);i++;main(1);}.  This relies on the assumption that the program is called with 0 arguments.

Most conversations regarding interpreter/compiler flags have resolved with each flag used costing a byte, but the - before being free.

Javascript 88 76 78 characters
setInterval('console.log(Array(Math.sin(i++/10)*20+21|0).join(" ")+"|")',i=50)

Based on Kendall Frey's code.

You never initialize i, so it prints a straight line instead of a wave.

My mistake... It probably worked because I had ran Kendall's script already in my console, so i was initialised already for me.

Ti-Basic, 33 bytes
While 1:Output(8,int(7sin(X)+8),"!":Disp "":π/30+X→X:End

The following caveats exist:

Due to screen limitation of 16x8, this sine wave only has an amplitude of 7 (period of 60 is still maintained)
Due to lack of an easy way to access the | char, ! is used instead
Due to lack of an accurate system timer, the delay is not implemented.  However, run speed appears approximately correct.

Heh, since TI-BASIC is counted in one-/two- byte tokens, this is actually 33 bytes (not "56 chars"), so it actually should have won the challenge!

Except for the amplitude thing...

Well, yes, but going by bytes it's fine.

 J - 103,58,57,54
Thanks to awesome guys from IRC
(0.1&+[6!:3@]&0.05[2:1!:2~' |'#~1,~[:<.20*1+1&o.)^:_]0

In words from right to left it reads: starting from 0 infinite times do: sin, add 1 ,multiply by 20, floor, append 1 (so it becomes array of 2 elements), copy two bytes ' |' correspondingly, print it, wait 0.05s and add 0.1
Instead of infinite loop we can use recursion, it would save 2 characters, but will also produce a stack error after some number of iterations
($:+&0.1[6!:3@]&0.05[2:1!:2~' |'#~1,~[:<.20*1+1&o.)0

Where $: is a recursive call.

Would you mind adding a little explanation, so that people unfamiliar with the J syntax (like me) can also understand your answer?

It's possible to shorten this to 50 characters by fussing about with the train's structure: (+2*(%20)6!:3@[2:1!:2~' |'#~1,~[:<.20*1+1&o.)^:_]0. The recursion version only saves 1 char this time $:@(+2*(%20)6!:3@[2:1!:2~' |'#~1,~[:<.20*1+1&o.)0 though it appears to last longer before bottoming out.

Haskell - 75
main=putStr$concat["|\n"++take(floor$20+20*sin x)(repeat ' ')|x<-[0,0.1..]]

Unfortunately, I couldn't get the program to pause 50 ms without doubling my char count, so it just floods the console, but it does produce the sine wave.

Here's the full code with pausing (138 chars with newlines):
import GHC.Conc
import Control.Monad
main=mapM_(\a->putStr a>>threadDelay 50000)(["|\n"++take(floor$20+20*sin x)(repeat ' ')|x<-[0,0.1..]])

Pausing was one of the requirements. Can you also post the code with the pause?

Okay, I posted it.  I wish Haskell let you pause code without imports.

By amplitude I mean the peak amplitude, i.e. twice the amplitude of your current program. You may wish to change it to 20+20*sin x instead to qualify.

Oh, sure.  I guess I misinterpreted that part of the question.

fugly Javascript - 77
i=setInterval("console.log(Array(Math.sin(i+=.1)*20+20|0).join(' ')+'|')",50)
and if we do it in Firefox - 73
i=setInterval("console.log(' '.repeat(Math.sin(i+=.1)*20+20|0)+'|');",50)
and if we're nasty - 67
i=setInterval("throw(' '.repeat(Math.sin(i+=.1)*20+20|0)+'|');",50)

JavaScript - 88
setInterval(function(){console.log(Array(Math.sin(i++/10)*20+21|0).join(" ")+"|")},i=50)

I'm sure someone can come up with something that's actually clever.

Perl 6: 46 chars
sleep .05*say ' 'x(25+20*.sin),'|'for 0,.1...*

Create an infinite lazy Range using 0,0.1 ... *, loop over that. say returns Bool::True which numifies as 1 in multiplication, this way I can keep it in a single statement.

I can see why sleep and .05 have to be separated. But I wonder if the space between say and ' ' is mandatory?

Yes :s It gives "2 terms in a row" error for say' ' One can use say(' ') but that's 1 char extra in this case...

@Matthias: In Perl 6, listops either have to not take arguments, have a space after them, or use parenthesis. It's not a language designed for code golf, unlike Perl 5 (but it contains many nice builtin features, so it's usable).

@xfix Thank you for the explanation. I like the language, but I did not look into it thoroughly yet, because I still cannot use it in a work project yet. However, I always plan to write some Perl 6 scripts. @ Ayiko, I appreciate your Perl 6 posts :-)

Scala, 92,89,87
def f(i:Int){println(" "*(20+20*math.sin(i*.1)).toInt+"|");Thread sleep 50;f(i+1)};f(1)

(20+20*math.sin(i*.1)) reduces it by 1 char, assuming this is valid syntax (I have no experience with Scala)

Thanks, but I have just discovered that myself :)

C#
[152] Characters
namespace System{class P{static void Main(){for(var i=0d;;){Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|');Threading.Thread.Sleep(50);}}}}

I could not get the Existing C# answer to Run and I couldn't downvote because I don't have enough Reputation
it was missing a couple of { and missing a ) after the For Loop Declaration.
I figure that the variance in the look of the wave when it is run is because of the way we are trying to display this wave.

if we aren't counting the Namespace and the Method Declaration then it would be
[104] characters for the working version
for(var i=0d;;){Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|');Threading.Thread.Sleep(50);}

The other C# answer works on gmcs. It fails to compile at first, but I think it is because there is some non-printable character in the source code. After typing it again on an empty file, the compilation is successful.

Compilers can be picky, huh?

VB [236][178]
not sure how you would count the tabs,  I just took the count from Notepadd++ before I pasted here.  newlines are mandatory, probably why no one likes using it for code golfing.
Module Module1
Sub Main()
Dim i
While True
Console.WriteLine("{0:" & (40 + 20 * Math.Sin(i = i + 0.1)) & "}", "|")
Threading.Thread.Sleep(50)
End While
End Sub
End Module

Bash+bc (to do the math), 80
$ for((;;i++)){ printf "%$(bc -l<<<"a=20*s($i/10);scale=0;a/1+20")s|
";sleep .05;}
                |
                 |
                   |
                     |
                       |
                         |
                           |
                            |
                              |
                               |
                                |
                                 |
                                  |
                                   |
                                   |
                                   |
                                   |
                                   |
                                   |

Python 3, 103
Stupid frikk'n imports...
import time,math
t=0
while 1:t+=(.05+t<time.clock())and(print(' '*int(20+20*math.cos(t*1.9))+'|')or.05)

Rather than "sleep", this implementation grinds at the cpu because python makes it easier to get a floating-point cpu clock than wall clock.  This approach won't beat friol's, but it's fun so I'm leaving it up.

C#
The Magic Line [91] Characters
for(var i=0d;;Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|'))Thread.Sleep(50);

Working Program Below. [148] Characters
namespace System{class P{static void Main(){for(var i=0d;;Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|'))Threading.Thread.Sleep(50);}}}

Sorry if I haven't made the question clear - your program should not terminate and should continuously scroll down the wave (except until SIGINT). Also, please add a character count.

Sorry forgot about that bit. Fixed now.

I think you can lose "Thread.Sleep"s and change "float" with var :) 117 chars. -- Sorry didn't see the wait time.. 133 chars now.
using System;class P{static void Main(){for(var i=0d;;Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|'))Thread.Sleep(50);}}

Yes I thought about changing it to var but wasn't sure about making changes after I got a +1. The reason I used Fully Qualified names is Thread uses the System.Threading namespace so it would have to be using System;using System.Threading;class P{static void Main(){for(var i=0d;;Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|'))Thread.Sleep(50);}} This ends up longer I think

Made the change by not using FQN's for Console and Math it saves 1 char. Also using var saves another 2 chars :-}

I'm just upvoting answers that I have verified to be correct. Feel free to shorten your code as long as the output is the same :)

I counted 150 characters for your working program. It's possible to shrink it to 148 by sticking the whole thing into the System namespace: namespace System{class P{static void Main(){for(var i=0d;;Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|'))Threading.Thread.Sleep(50);}}} see http://codegolf.stackexchange.com/a/184/4163

Ha nice one Bob. I wouldn't have thought about that.

I can't get it to compile in VS2010 with Threading.Thread.Sleep(50) am I doing something wrong?

I was able to get it to run, but I had to add some Brackets and Semi-colons and it doesn't look the same every period

Compilation failed on gmcs also after direct copy-and-paste of the sourcecode due to Unexpected character. I retyped the sourcecode on a new file and it works again. I guess there is some non-printable character hidden in this code, leading to the compilation error.

There must have been a hidden character added when I pasted the code here. It is fixed not. Also Malachi there is nothing wrong with the number of ')' and '}' characters and their placement. The only thing that is wrong is your understanding that you can place a statement inside the for loop

Julia - 68
Edit: thanks to  M L and ace.
i=0;while 0<1;println(" "^int(20sin(.1i)+20)*"|");i+=1;sleep(.05)end

Well, it can not compete vs APL, but here's my attempt.
Output:
                    |
                      |
                        |
                          |
                            |
                              |
                               |
                                 |
                                  |
                                    |
                                     |
                                      |
                                       |
                                       |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                    |
                                   |
                                  |
                                |
                              |
                             |
                           |
                         |
                       |
                     |
                   |
                 |
               |
             |
           |
         |
        |
      |
     |
    |
   |
  |
 |
|
|
|
|
|
 |
 |
  |
   |
     |
      |
       |
         |
           |
             |
              |
                |
                  |
                    |
                      |
                        |
                          |
                            |
                              |
                                |
                                 |
                                   |
                                    |
                                     |
                                      |
                                       |
                                       |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                    |
                                   |
                                 |
                                |
                              |
                            |
                          |
                        |
                      |
                    |
                  |
                 |
               |
             |
           |
         |
       |
      |
     |
   |
  |
  |
 |
|
|
|
|
|
 |
  |
  |
    |
     |
      |
        |
         |
           |
             |
               |
                 |
                   |
                     |
                       |
                         |
                           |
                            |
                              |
                                |
                                 |
                                   |
                                    |
                                     |
                                      |
                                       |
                                       |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                    |
                                  |
                                 |
                               |
                              |
                            |
                          |
                        |
                      |
                    |
                  |
                |
              |
            |
           |
         |
       |
      |
    |
   |
  |
 |
 |
|
|
|
|
|
 |
  |
   |
    |
     |
      |
        |
          |
           |
             |
               |
                 |
                   |
                     |
                       |
                         |
                           |
                             |
                              |
                                |
                                  |
                                   |
                                    |
                                     |
                                      |
                                       |
                                        |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                    |
                                  |
                                 |
                               |
                             |
                            |
                          |
                        |
                      |
                    |
                  |
                |
              |
            |
          |
         |
       |
      |
    |
   |
  |
 |
 |
|
|
|
|
 |
 |
  |
   |
    |
     |
       |
        |
          |
            |
             |
               |
                 |
                   |
                     |
                       |
                         |
                           |
                             |
                               |
                                |
                                  |
                                   |
                                    |
                                      |
                                      |
                                       |
                                        |
                                        |
                                        |
                                        |
                                        |
                                       |
                                      |
                                      |
                                     |
                                   |
                                  |
                                |
                               |
                             |
                           |
                         |
                       |
                     |
                   |

I don't know Julia, but is it possible to use .05 instead of 0.05 in sleep?

Actually yes! Thanks

Cut it down to 68 characters:  i=0;while 0<1;println(" "^int(20sin(.1i)+20)*"|");i+=1;sleep(.05)end———sin(i/10)*20 is equal to 20sin(.1i)

I don't know Julia, but could you use a for loop iterating over all the natural numbers instead?

MATLAB, 81 bytes
t=0;while(fprintf('%s\n',i))i=[];t=t+1;i(fix(21+20*sind(t*6)))='|';pause(.05);end

I abused the fact that i is always initialized in MATLAB, which meant that I could put the fprintf in the while statement without initializing i first. This does mean the program first outputs an empty line, but I think this is not forbidden in the spec.
Furthermore, it abuses the fact that Matlab will ignore most ASCII control characters, printing a space instead of NULL (also for the first empty line).

"I abused the fact that i is always initialized in MATLAB, which meant that I could put the fprintf in the while statement without initializing i first." Really clever! +1!

TI-BASIC, 30 bytes
Small size improvement over the other answer, at the cost of some accuracy. Note that TI-Basic technically has the | character, but you have to transfer it via computer or use an assembly program to access it.
While 1
Output(8,int(8+7sin(Ans)),":
Disp "
.03π+Ans
End

Woah, did not see how old this challenge was! Was going to try to golf this more (which is definitely possible) but it's really not worth it...

By the way, .03π can be .1, which is still within the required interval.

Nice catch, thanks! Do you see any way I could golf the output command? Also, since I have a CSE, I could get this to the right amplitude (26-char screen) at the cost of a few bytes.

No, the output command looks fine--too bad the Disp needs a quote. The amplitude should be 20 chars, actually, making the screen width requirement 39. So it would only work on the graph screen, and there's no short way of doing that.

F# - 90 79 77 76
Here's a solution using recursion
let rec f x=printfn"%*c"(int(20.*sin x)+21)'|';Thread.Sleep 50;f(x+0.1)
f 0.

It could probably be improved further.

Without knowing anything about F#, I'm assuming that Thread.Sleep expects a value in ms, so you can get rid of one of the 0's and do Thread.Sleep 50. :)

@ValarDohaeris You're right. I misread the requirements.

AutoHotkey 176
SetKeyDelay,-1
run Notepad.exe
WinWaitActive, ahk_class Notepad
p:=0
loop
{
sleep 50
p+=Mod(Floor(A_index/40),2)?-1:1,t:=""
loop % p
t .= " "
sendinput % t "|`n"
}
esc::Exitapp

Run the script . It opens Notepad and prints the characters. Press Esc anytime to exit.

Clojure, 121
Short version:
(loop[a 0](println(clojure.string/join(repeat(int(+ 20 (* 20 (Math/sin a)))) " ")) \|)(Thread/sleep 50)(recur(+ a 0.1)))

Pretty version:
(loop [a 0]
  (println (clojure.string/join (repeat (int (+ 20 (* 20 (Math/sin a)))) " ")) \|)
  (Thread/sleep 50)
  (recur(+ a 0.1)))

Period is 64.
Type this into lein repl or save in file sin.clj and run with lein exec sin.clj (requires lein-exec plugin).

Groovy 87 Chars
Okay, now for a serious answer that actually follows the guidelines
def x=0;while(true){println ' '*(20*Math.sin(x)+20)+'|';x+=0.1;Thread.sleep(50)}

Do you think a suitable decimal approximation for Math.PI/30 can save you a few chars?

CJam, 42 bytes
CJam is a bit younger than this challenge, but since this submission doesn't beat APL anyway, I don't see a problem with that.
es{es1$m50>{500d/ms21*K+S41*\i'|tN+oes}*}h

This won't work in the online interpreter, so you'll have to use the Java one.
The basic idea is to keep a timestamp on the stack, and whenever 50 ms have passed since the last timestamp, a new line is printed (where the sine is computed from that last time), and a new timestamp left on the stack.

Pascal: 99 characters
uses Crt;var i:Real;begin
repeat
Writeln('|':Round(Sin(i)*20+21));i:=i+0.1;Delay(500)until 0=1;end.

Another task where Pascal's output formatting comes handy and everything else is pain.

Julia, 60 chars
Unlike CCP’s solution, mine uses a recursive function:
a(n)=(print(" "^int(20sin(.1n)+20)*"|\n");sleep(.05);a(n+1))

Example:
julia> a(1)
                      |
                        |
                          |
                            |
                              |
                               |
                                 |
                                  |
                                    |
                                     |
                                      |
                                       |
                                       |
                                        |
                                        |
                                        |
                                        |
                                       |
                                       |
                                      |
                                     |
                                    |
                                   |
                                  |
                                |
                              |
                             |

SmileBASIC, 44 bytes
@L
A=A+.1?" "*(COS(A)*20+20);"|
WAIT 3GOTO@L

PowerShell, 57 bytes
for(;;sleep -m 50){' '*(20*[math]::Sin(($i+=.1))+20)+'|'}

Try it online!

05AB1E, 20 bytes
['|NT/Å½20*21+ú,50.W

Try it online.
Explanation:
[               # Start an infinite loop:
 '|            '#  Push character "|"
 N              #  Push the 0-based loop-index
  T/            #  Divide it by 10
    Å½          #  Take the sine of that
      20*       #  Multiply it by 20
         21+    #  Add 21
            ú   #  Pad that many leading spaces before the "|"
                #  (`ú` will ignore any decimal digits and interpret it as an integer)
             ,  #  Pop and print this string with trailing newline
 50.W           #  Sleep 50 ms

Japt, 20 bytes
Open your browser's console.
50i@Ol|ùMsU°/A Ñ0+21

Test it

Scala, 92 82 bytes
Saved bytes thanks to the comments.
Golfed version. Try it online!
def f={var i=0;while(i<101){println(" "*(21+(math.sin(i*.1)*20).toInt)+"|");i+=1}}

//math.sin
//scala.math.sin
//Math.sin
//java.lang.Math.sin
//WHATEVER

Ungolfed version. Try it online!
import scala.math._
import scala.concurrent.duration._

object SineWave extends App {
  var i = 0

  def animateWave(): Unit = {
    //while (true) {
    while (i<=100) {
      val j = 21 + (sin(i * 0.1) * 20).toInt
      println(" " * j + "|")
      i += 1
      //Thread.sleep(50)
    }
  }

  animateWave()
}

I think you should be able to do math.sin instead of scala.math.sin. Also, I think f can be def f=, not sure if that's allowed though.


text:
Anti-golfscript anti-golf: create a task where GolfScript or J is outgolfed by your (conventional) lang
You need to make three things:

Statement of a task, T.
Solution of the task in language not typically used for golfing, A.
Solution of the task in language typically used for golfing, B. Don't try to just bloat up B to pump up the score, instead think as if B was written by your competitor.

Use common sense in defining typically used for golfing, try to maximize fun for other users.
Other users may propose better Bs (maybe including in other "golfy" languages).
Scoring is (length_in_bytes(B)+5)/(length_in_bytes(A)+5), more is better. (Maybe the scoring formula should be changed?..)
The main idea is to invent a task where languages that typically perform well in codegolf meet a problem. It can be sudden strength of a usual language in the given task or sudden weakness of some golflang.
Avoid tasks that mention specific programming languages, like Input a string and execute it as a Scheme code.

I suppose that you make this a popularity-contest instead of a code-golf. Otherwise people will complain that it is not a "shortest-code-wins".

OK, changing to popularity-contest. You can also suggest better title or better scoring.

I assume my previous question qualifies? https://codegolf.stackexchange.com/questions/18633/print-a-sinusoidal-wave-vertically The perl solution is 48 chars while the J solution is 54 chars

Numerator is supposed to be minimum of length_in_bytes for all suitable B's.

@ace, Yes, linking to existing specific problems with specific solutions is OK; can be posted as answer (copied summary of the statement + links to A and B)

Do we get to specify lang B (as long as it is good at golfing)? Or can anyone say "here is a program in language  and it has a very short solution of length :"?

@Quincunx, As it currently has "popularity-contest", bending "use common sense to decide what is golf language and what is not" rule is just expected not to be upvoted.

@Vi. Wasn't trying to bend that rule; just wondered if anyone can say "here is a shorter version in MY language" and wreck the score.

@Quincunx, If the task is based on "A suprising strength of some A" then yes; if on "A suprising weakness of some language for B" then no. The alternative solution can be posted in comments in any case, so others can calculate alternative score.

BTW some languages like Perl can be both on A side and on B side, depending on context.

What if it's extremely difficult to do on B? I have perform OCR in mind which mathematica can do as shown here http://codegolf.stackexchange.com/a/17094/8766 but would be very difficult in languages not specifically built for it

@user80551, Then provide a proof that B 1. there exists implementation of the task in B; 2. each implementation of the task in B must take not less than N characters.

@Vi. See the edit

@user80551, OCR? There can't be short and golfable OCR algorithms? Actually you may write something like I believe it can't be done in less than 5000 bytes on languages B1, B2 or B3. If other savvy user disagrees, he/she may provide a counterexample (shorter working solution in B). This is less funny although...

Why was this closed as off-topic? It seems to have an objective winning criterion to me?

My previous question, Print a sinusoidal wave (vertically), qualifies at this moment. I'm posting it here as a solution, also hoping that you guys can come up with some shorter solutions to my original question.
As required by Vi., I will post a summary of the question.
Print a continuous sinusoidal wave scrolling vertically on a terminal. The program should not terminate and should continuously scroll down the wave (except until SIGINT). You may assume overflow is not a problem (i.e. you may use infinite loops with incrementing counters, or infinite recursion).
The wave should satisfy the following properties:

Amplitude = 20 chars (peak amplitude)
Period = 60 to 65 lines (inclusive)
The output should only consist of spaces, newline and |
After each line of output, pause for 50ms

There is a sample output on my original question, but I'm not posting it here, because this will make my answer ridiculously long. My original question can be seen here: Print a sinusoidal wave (vertically)
Shortest A currently: a Perl solution with 48 chars:
https://codegolf.stackexchange.com/a/18655/12205
print$"x(25+20*sin).'|
';$_+=.1;`sleep .05`;do$0

Shortest B currently: a J solution with 54 chars: https://codegolf.stackexchange.com/a/18649/12205
($:+&0.1[6!:3@]&0.05[2:1!:2~' |'#~1,~[:<.20*1+1&o.)0

Currently, the score of this answer is 1.113 (an awfully low score)

The current score according to current formula is approximately 1.113

@Vi. should I delete this answer or should I wait some time and see what happens? If the latter, how long should I wait?

The statement states bytes, not characters. Converted to UTL-8, the APL solution made 61 bytes (70 for UTF-16).

You're claiming that Perl is not a language typically used for golfing, but it's the language which was first associated with the word golf! Ruby, at 56, looks like the real language A in the current answers to your questions.

Add two numbers
Get two numbers from STDIN, and add them together. You have to support floating point numbers, so 0.5 + 1.5 has to equal 2.
Perl 5 (with -E)
say<>+<>

GolfScript
n%'+'*'"#{
}"'n/\*~

Calculated score as (24+5)/(8+2+5) = 1.9(3). -E also counted as program bytes.

The same comment as I made to ace: you're claiming that Perl is not a language typically used for golfing, but it's the language which was first associated with the word golf!

And your GolfScript program doesn't work. A working program would be n%'+'*'"#{ }"'n/\*~ where the character between {} is a literal newline (not supported in comments).

@PeterTaylor, Compared with GolfScript, Perl is a "usual" language; compared with Java, it's a "golf" language.

Score using PeterTaylor's golfscript variant: 1.6. I can although successfully run neither of variants with my GolfScript interpreter (md5 = 8bb179c2eb47060026a9a598a4263900).

The J for this isn't too bad, actually: +/".1!:1,~1. APL would probably be even smaller.

In Pyth, this is just s.Q, and in O, jj+.

Print 'Hello, World!' to the stdout.
PHP, 13 bytes
Hello, World!

Golfscript, 15 bytes
'Hello, World!'

Pyth, 14 bytes
"Hello, World!

Nicely topical. :)

New B: In HQ9+ H

But it's spelt incorrectly, @NotthatCharles

@georgeunix Good point.  You capitalized your "W".

Score 48/37 or 1.(297)
T: write a code snippet that ends the program after exactly one hour (as close as possible, like within a second) of running. Don't worry about exceptions, they can be unhandled.
A: Java (32)
Thread.sleep(3600000);int a=1/0;

B: is for Befunge 98, requires the TIME fingerprint (43)
"EMIT"4(HMS00p01p02p#;gS-!01gM-!H-!++3-!j;@

This takes the Hour, Minute, and Second at the time of running, and puts the at cells 02, 01, and 00. Then, it skips over the ; to the second part. The second part works as follows:
g          get the value at 00
"EMIT"4(S) get the current time in seconds
-!         subtracts the values and changes a 0 to 1, anything else to 0

similarly for the Minute and Hour.
++  sums up the values
3-! i the sum is 3, we get a 1, otherwise, we get a 0.
j   jump over the next that many cells
;   skip code execution until the next ;
@   end program

Note that Befunge will automatically go back to the beginning of the line when the end of a line is reached.

As we can see, Befunge is not good when it comes to waiting for specific times. However, Java is not bad.

thought I'd make the code difference even bigger; now it is clear who is better.

APL: ⎕DL 3600

Java usually reads as class Main{public static void main...

@Vi. see "code snippet". Basically, it requires the code that actually does the work, not more than that.

@marinus okay APL is good too, but Befunge is not.

This task is still a valid answer. To sleep in the GNU/Linux bash shell (as A), sleep 1h works, and is still shorter than (by byte count, otherwise of the same length as) the APL solution by @marinus :)

Python's import time\ntime.sleep(3600) is also OK (as A) and is 28 bytes.

@Vi. Ah, but python can be quite good at golfing. The Java code is also valid, so I'll keep it as that.

Tcl: after 3600000. Why do people bring brainfuck to claim that a certain task is hard to golf in a regular golf language?

@JohannesKuhn What are you talking about? Befunge (I'll assume that is what you meant) is the language I golf in.

I don't know Befunge, but the Java snippet doesn't "end the program" as required by the spec. That would require either a System.exit(0); or wrapping your sleep in a main method.

@PeterTaylor Rather than the verbose System.exit(0), I can use int a=1/0 to terminate by exception. The Befunge snipped does end the program; eventually, the IP will reach the @.

@Quincunx Why can't you just remove the int a= part?

@DoorknobofSnow Fails to compile: error: not a statement

Your befunge code isn't golfed well enough. You can just do "EMIT"4( at the beginning of your program, rather than every single time you need to get the time. Fixing this problem qould reduce your score to 1.3

Also, I don't think you need self-modifying code for this.

In addition, your befunge will fail if run when the hour, minute, or second is exactly 59 (the ascii value of ';')

Output a certain text file (498.388888 points)
The goal output is here.
The Python 3.4.3 script to print it is 49 bytes:
for b in dir(__builtins__):print(eval(b).__doc__)

The naive CJam program equal to the goal output, by wrapping the output string in "..." and escaping each " that occurs in it, would be 26908 bytes.

Very clever, though it may run afoul of the "specific languages" restriction (which is vague, admittedly).

The closest rule is "avoid mentioning specific language". Python is not mentioned, but is clearly meaned.

Yeah, this answer is a bit tongue-in-cheek, I sort of just wanted to point out that the rule is sort of a slippery slope. Imagine if I had "mangled" the output more -- say, taking the SHA1 checksum of each docstring -- it would be very weird to claim "this garbled bunch of hex digits is too language-specific" :)

If I wanted to do a more "fair" answer, I'd probably use Mathematica. You can do a lot of extremely domain-specific things in it that would take thousands of bytes of CJam/Pyth/anything else. But sadly, I don't  know the language.

Link to output is dead.

Say "Hello world!" (50 / 26 ≈ 1.92)
Show a message box to say "Hello world!"
JavaScript
alert('Hello world!')

In a browser with support for DOM Level 0+.
Perl
use Win32;Win32::MsgBox('Hello world!','',48)

Running on ActivePerl with Win32::GUI.

alert isn't inherently part of JS, and the GolfScript program is just a comment.

I've changed the answer to use plain Perl.

Output "Hello world!" until user presses "q", 1.842 105/44 = 2.386

Print "Hello world!" (including newline).
The user presses a key, which is not echoed to the screen.
Repeat until the key pressed was "q".

QBasic (52 39 characters)
1?"Hello world!":IF"q"<>INPUT$(1)THEN 1

Since posting my original answer, I discovered that I could turn off autoformatting in QB64. :^D With the line number and ? shortcut for PRINT, this looks rather like a ternary expression in C-like languages.
First version:
PRINT "Hello world!"
IF INPUT$(1) <> "q" THEN RUN

Perl 5 (100 characters)
while("q"ne$e){print"Hello world!\n";system"stty cbreak -echo";$e=getc;system"stty -cbreak echo";}

The above will only work on (certain?) UNIX systems (tested on Ubuntu 12.04). It's possible that one could go cross-platform and get it down to 91 characters using the Term::ReadKey module, but I haven't tested it:
use Term::ReadKey;while("q"ne$e){print"Hello world!\n";ReadMode 3;$e=ReadKey 0;ReadMode 0;}

Hello, world (3 1/3 points)
Write program that outputs Hello World..
HQ9+ (1 character)
This is not language "typically used for golfing", so I believe it fits here. Works in this interpreter, by the way.
H

GolfScript (15 characters)
I doubt it can get any shorter, even if it's GolfScript.
"Hello World."

I don't think HQ9+ suits as A language. It is designed for tricks/riddles/fun. Brainfuck/unlambda/other esoterical languages also does not seem to suit as A.

@Vi.: But it's not typically used for golfing.

You can hovewer try to use HQ9+ as B language and beat it by Java or such...

Looks like there's a hierarchy: Compared to Java, Perl's a golflang. Compared to Perl, GolfScript is a golflang. Compared to GolfScript, HQ9+ is a golflang...

@Vi.: I carefully checked your task description. HQ9+ is never used for golfing, except for two particular tasks - "99 bottles", and "Hello, world". Unless you can show some other task in which HQ9+ wins with any other programming language, I still think it fits the definition, even if it abuses it (hey, it's [tag:popularity-contest]). HQ9+ is simply not used for golfing stuff not related to those two tasks. So, it's not typically used for golfing. The second is obviously designed for CodeGolf - it's GolfScript.

OK, considering it as "the best abuse of rules" nomination.

@xfix one more case where HQ9+ is the best at golfing: Quines (when disallowing the empty program)

@Quincunx: Here, I win in GolfScript, Befunge, and PHP - 1. You wouldn't tell me that PHP is golfing language, and yet it has a short quine. Actually, in PHP, any single character is a quine.

@xfix That is not a quine in Befunge.

@Quincunx: Uhm, yeah, my mistake. Well, bc then.

@Vi compared to Java, anything's a golflang.

Output "Hello world!", 33/97 = 2.94
Write a program that outputs Hello world!
Arduino or GML
Serial.print("Hello world!")

or
show_message("Hello world!")

Both are 28 characters.
GTB
I use GTB for golfing a lot (especially since I created it myself, and it is Turing complete). Unfortunately, there is only limited support for lowercase characters (because TI-84 calculator can't deal with it). This is probably the shortest GTB program that can output Hello world!
S;"lower",1,1)→_~"H"+S;"expr(",1,1)+_+_+S;"cos(",2,1)+" W"+S;" or ",2,2)+_+S;" and ",4,1)+"!

92 characters.

Does GTB version also output it to serial port?

Is GTB version intentionally bloated up with various coss and exprs or it genuintely can't just output something in regular way? Or " character is actually not a string literal and confusing me...

@Vi. It's not bloated up at all... it has to strip e from expr, two l from lower, o from cos, or from or, l from lower, and d from and.

'Other users may propose better Bs (maybe including in other "golfy" languages). ' --- let me try golfscript: "Hello world!"

@JanDvorak You're probably right.

Never thought I'd see GML used here.

@ipi I've used it in several other answers.

TI-BASIC's lowercase Hello World program is just "Hello, world with lowercase letters typed in using some sort of utility; additionally sub( does not work like that.

Umm yeah, not sure what I was thinking when I wrote this answer, sorry about that.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Create a fractal tree
What I would like to see is a fractal tree being drawn where the you can input an integer, and the output will be a fractal tree with the entered amount of branch steps.
Rules:

The fractal should be a line fractal tree:
the shape of the fractal should also be the same as this picture.
Each branch should decrease by 25% in width for each time it splits
The final layer of branches should be an 1px wide line
Shortest code wins

Tip: this site might be useful.

This question seems different enough from "Sorry, young man..." and I'm voting to reopen. For one, this doesn't require an L-system, and it is more precise in its description of the output. Answers to the other aren't necessarily the best answers here.

If there's no new answers in the next day, I'll mark the shortest code as accepted.

Can this tree be made with leaves ?

@w4nteD The challenge of course does not specify any leaves, but I daresay they would be fairly easy to add to most of these programs. After the recursion decides to return, draw a leaf before returning. The current branch angle will be available for orientation. You could draw a leaf shape in the same direction, or maybe two at slight angles similar to the branching.

Context Free, 82 65 57 characters
rule T{9*[y 1]SQUARE[]2*{f 90}T{s.75y 8r 25}}startshape T

See: http://www.contextfreeart.org/gallery/view.php?id=3384
Golf'd further with help from Context Free Art users minimaleye, MtnViewJohn, and kipling.

According to a comment on that link you posted, it can be reduced to 64 characters. Nice one!

Upvoting not only because it's a good answer with pretty output, but because I have never even heard of this language before.

Python - 215
import turtle
t=turtle.Turtle()
def f(w):
    if w>=1:
        s=t.pensize()
        t.pensize(w)
        t.fd(w*9)
        t.rt(20)
        f(w*.75)
        t.lt(40)
        f(w*.75)
        t.right(20)
        t.bk(w*9)
        t.pensize(w)
t.speed(9)
f(9)
t.ht()
raw_input()

Close enough?

I'll accept it, because I just said that the "shape" should be the same. I didn't specify any orientation rules.

a little more documentation (or at least meaningful names) could be very nice

Documentation? This is a complete program. Run as-is, no arguments, no nothing. Meaningful names? You cannot fit a lot of meaning into 1 character, and last time I checked this is [tag:code-golf]

I think "commentary" might be the word. I know that to a Python hacker, it must be very clear, and maybe to English-speakers who can recognize the abbreviated names, and turtle-graphics fans (like me) it is, but for others who don't know the language but want to vote you up, give them some help, you know? Tell a little story, even if it's just "the problem domain maps naturally to this feature set". Does that help?? I think that's what's going on here. ... Or at least, that's a practical way to interpret such comments. :)

I think that n>=1 can be reduced to just n

How fitting that you used the turtle library for a fractal problem :)

Mathematica 127
k=12;

r=#2/.{x__Real}:>.1{{7,-#},{#,7}}.{x}+y&;
f@n_:={f@1=N@Polygon@{y={0,.7^k},0y,x={.002,0},x+y},r[-4,p=f[n-1]],4~r~p}
Graphics@f@k

Value .002 adjusted to produce 1 pixel width of the final branches.

Logo, 88, 86
to t:d if:d=0[stop]setpensize:d*.75 fd:d*7 rt 25 t:d-1 lt 50 t:d-1 rt 25 bk:d*7end t [numsteps]

Edit: Made the branches decrease as pointed out in the comments.

Your branches don't get shorter the further up the tree we go. This was one of the requirements, since "the shape of the fractal should also be the same as this picture". Also, you should include the code to create the tree in the character count. Other than that, well done on the short code!

Also, your branch width isn't decreasing geometrically at 25% each time - it's linear based on the iteration number.  I set my pen size to (4/3)^(:d-1) to accomplish this.
The lowest I got in my Logo attempt was 108. Nice work!

HTML+CSS (no JavaScript) 14791 14630 (multiplatform), 294 (webkit only)
You can't specify how many levels you go.. And yes it is pretty big. But it is pure HTML/CSS, without any JavaScript.
<q class="start"><q><q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q></q><q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q></q></q> <q><q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q></q><q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q><q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q><q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q><q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q><q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q><q><q><q><q></q><q></q></q><q><q></q><q></q></q></q><q><q><q></q><q></q></q><q><q></q><q></q></q></q></q></q></q></q></q></q></q></q>

Webkit short version:

Edit: removed the cross browser prefixes, firefox and google chrome render it properly without it.
Edit 2: Added a much shorter version that uses -webkit-box-reflect. Only works in webkit based browsers though.

<q class="start"><q></q><q></q></q>
With only three branches and removing non needed CSS components for cross-browser compatibility the code is 321 characters long. Adding a level of branches is done by replacing  with .

Ha, this got an "excessively long" automatic flag. :D It would be interesting if you posted the code to generate this (or explain how you did it). (Assuming you didn't do it by hand!)

Doorknob: The core CSS code that does the real 'magic' is in the beginning, it 'recursivly' positions sub HTML in the correct way using transforms, such that they form the tree. The HTML itself I did manually, but isn't hard. I start with  and use my code editor to replace that with . Every time I repeat this replacement operation I add a level of branches to my fractal. The CSS automatically wil render the added levels correctly. My previous comment demonstrates this.

Mathematica 199
f[p : {_, _}, r_, s_, d_] := Module[{q}, If[d == 0, Return[]];
  q = p + {Cos@r, Sin@r}*d;
  DeleteCases[
   Flatten@{{Thickness[.002*1.25^d], Line@{p, q}},
     f[q, r - s, s, d - 1], f[q, r + s, s, d - 1]}, Null]]
g@d_ := Graphics[f[{0, 0}, Pi/2, Pi/9, d]]

Example
8 is the depth of the tree.
g[8]

Postscript 216 214 209
Uses the criteria "linewidth==1 pixel" as the recursion bound.
Edit: juggled some constants. Edit: tweak,  tweak.
/b{gsave dup scale rotate
0 0 0 12 0 0 moveto translate lineto stroke
currentlinewidth 0 dtransform dup mul exch dup mul add sqrt 1 ge
{28 .75 b -28 .75 b}if grestore}def
2 setlinewidth
200 20 translate
0 6 b

binary-token workfile:
0 6 200 20 2
/.{<920>dup 1 4 3 roll put cvx exec}def/${//. 73 .}def
%/b{gsave dup scale rotate  % gsave=78(N)<4E> dup=56(8)<38> scale=139<8B> rotate=136<88>
/b{
%(N8)$<8B88>$
<4E388B88>$
0 0 0 12 0 0
%moveto translate lineto stroke
% moveto=107(k)<6B> lineto=99(c)<63> translate=173<AD> stroke=167<A7>
%(k)$<AD>$(c)$<A7>$
%<6B63ADA7>$ % <--this typo makes a pot leaf. :-)
<6BAD63A7>$
%currentlinewidth 0 dtransform % clw=38(&) dxfm=55(7)
0(&7)$
%dup mul exch dup mul add sqrt 1 ge % mul=108 sqrt=355 ge=74 add=1 exch=62
(8l>8l)$ add sqrt 1 ge
{28 .75 b -28 .75 b}
%if grestore}def % grestore=77(M) if=84(T) def=51(3)<33>
(TM)$
}
%(3)$
%setlinewidth % slw=155<9B>
%translate % trsl8=173<AD>
<339BAD>$ b

Postscript 172 169
Same program using binary token strings.
/.{<920>dup 1 4 3 roll put cvx exec}def/${//. 73 .}def
0 6 200 20 2/b{<4E388B88>$ 0 0 0 12 0 0<6BAD63A7>$
0(&78l>8l)$ add sqrt 1 ge{28 .75 b -28 .75 b}(TM)$}<339BAD>$
b

CoffeeScript (using Canvas) (289 bytes)

The following creates branches until the pixel width is less than 1px. The width and height of the image created is 500px. To see the virtual image that the program draws, add document.body.appendChild(c) to the last line of the code.
c=document.createElement 'canvas'
c.width=c.height=500
t=c.getContext '2d'
m=Math
b=m.PI/8
f=(w,l,x,y,a)->
    t.beginPath()
    t.moveTo x,y
    X=x+m.cos(a)*l
    Y=y+m.sin(a)*l
    t.lineWidth=w
    t.lineTo X,Y
    t.stroke()
    if w >= 1
        f w*3/4,l*3/4,X,Y,a+b
        f w*3/4,l*3/4,X,Y,a-b
f 10,90,250,0,m.PI/2

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Hello world!!! Fibonacci distribution

Your program should output exactly: Hello world!!! with or without linefeed after.
Your program should take no input.
Sourcecode character distribution must be correct according to:

The number of numeric characters (0-9) must be exactly one fibonacci sequence number.
The number of other non-numeric characters !(0-9) in the sourcecode must be exactly the fibonacci sequence number before the above fibonacci sequence number.

Four examples of valid character distribution in sourcecode:

13 numeric, 8 non-numeric characters.
34 numeric, 21 non-numeric characters.
55 numeric, 34 non-numeric characters.
89 numeric, 55 non-numeric characters.

This is code-golf, shortest code in bytes wins! Good luck!
Edit: As this question has constraints on the sourcecode size in combination with being code-golf the accepted answer (if more than one share the equal winning character length) will be the answer with most votes (and least character-count): 2014-03-01.

Thus, all solutions have a character count which is a fibonacci number.

@Howard Indeed. This is a very interesting problem.

Here is a program to validate answers (paste the code into the input box.)

Is it even possible to do this in less than 55 characters? The required output has 14 chars, and I can't think of a language that can use numbers to output chars without using at least one character per char.

I regret I didn't put a constraint on the distribution for the non-numeric too, separating alpha-characters and symbols. Is it okay to update the rules now this late, rendering your answers invalid?

@Plarsen definitely not OK

Okay, I will not change the rules then :)

@Quincunx: It is possible.

@xfix it might be, but your solution doesn't achieve that

Questions without an objective primary winning criterion are off-topic, as they make it impossible to indisputably decide which entry should win. A codegolf challenge where the code length is forced to be a certain value lack such a criterion.

I added a criterion for who will win if more than one answer shares the same character count.

@Plarsen Why don't you change it and say: "write the smallest program you can" and change [tag:code-golf] to [tag:popularity-contest]?

What would have been even more interesting would be to specify that all characters had to be functional - that is, comments and non-essential code could not contribute to the character count.

I agree, @Iszi.  I threw answers in, in two languages because padding with comments made it easy.  However, while "no comments" could be construed as objective criteria, I think "non-essential code" could be seen as subjective. (It's usually easy to weave some numeric calculation or string manipulation into code which does something and, if cleverly woven, cannot be removed without fundamentally rewriting the answer.)

This question seems to have been left in a state where it contradicts itself about the winning criterion, and I am therefore voting to close it as off-topic.

I’m voting to close this question because it contradicts itself about the winning criterion.

@pppery It doesn't contradict itself. It clearly states that [popularity-contest] is used as a tiebreaker.

Windows Command Prompt - 34, 8, 5 chars, (2 below)
*These ones may or may not be breaking rule 2, but here it is anyway
%~099

Name the file:
&start call echo Hello world!!!&exit -b .cmd

Now lets corrupt the file-system a little - 2 chars (or less if you want)
A1

Name the file (using your preferred unorthodox method):
"&start call echo Hello world!!!&exit&.cmd

How does this work:
Since cmd scripts are invoked with 'cmd.exe /C "%1" %*' the executed command will be:
cmd.exe /C "c:\PATH_TO_THE_SCRIPT\"&start call echo Hello world!!!&exit&.cmd"

which will in the following order:

Fail to execute "c:\PATH_TO_THE_SCRIPT\"
Open a new shell printing Hello world!\n
Exit the original shell

Wow! I think we had got a winner if the rules wasn't saying no input. +1 anyway for the outside-of-box thinking.

Code golf with Windows CMD... +1. Also, it is arguable that "no input" could have meant "no reading STDIN" :P

That's an interesting trick for other code golfs too… write the real code in the file name and use something like eval $0 to execute it

That's impossible!! 5 chars? Really interesting approach

In fact, I've just posted a 2 char solution below.

Just for reference these types of answers are not allowed by this loophole, however it predates the creation of the loophole so us moderators will not be accepting flags to delete it right now.

MySQL, 34
x'48656C6C6F20776F726C642121'||'!'

This is a MySQL expression that evaluates to Hello world!!!, assuming the sql_mode setting includes PIPES_AS_CONCAT. It contains exactly 21 digits and 13 non-digits.
Whether this qualifies as a valid entry, I leave it to the jury.
Example
mysql> select x'48656C6C6F20776F726C642121'||'!';
+------------------------------------+
| x'48656C6C6F20776F726C642121'||'!' |
+------------------------------------+
| Hello world!!!                     |
+------------------------------------+
1 row in set (0.00 sec)

What the... CMD and SQL winning code golf??

The select and ; are arguably part of the statement, but still a clever solution.

@primo they are, that's why I'm unsure whether this qualifies. But I thought I'd post it for hilarity ;-)

C64 BASIC, 55

For fun and nostalgia!

GolfScript, 55 characters
[72 101 108 108 111 32 119 111 114 108 100 33 {.}2*]''+

Didn't find a way to have a 34 characters solution, thus I created this one.

Befunge 98 - 55
a"!!!dlrow olleH"ek,@1235813213455891442333776109871597

Decided to do it with a newline, since it doesn't cost anything. The numbers are the concatenated values of the Fibonacci sequence.

Python 34-55
print "Hello world%s"%("!"*int(3.141592653589793238462643383279502884197169399375105820))

Yes. I waste them digits. What are you gonna do about it?

Who knew pi~3 would be so useful!

The question says 21 non-numeric plus 34 numeric, your answer is 34 non-numeric plus 21 numeric.

the "hello world" should be "Hello world"; that is capitalize the h.

Windows PowerShell (probably also Bash), 55
curl -L bit.ly/1b9q8ve?1=123581321345589144233377610987

You didn't say anything about network access, so here's a dirty solution. I've got a bit.ly URL with few enough letters on the second try. Unfortunately, It's still 21 non-digits, needing 34 digits to be used or wasted.

You know you can edit the bit.ly links right?

What do you mean, edit? Also, I wouldn't get this under 13 letters in any case.

You can hit the pencil next to "Copy" and edit the link. If you do, all the old versions will still work.

Shortened to 34! curl 37.187.42.18/?hw=112358132134

C (89 characters)
main() {
int i[0000000000000004]={1819043144,1870078063,560229490,2566922529};
puts(i);
}

While the above is valid, unfortunately, my efforts to compact it with the following program doesn't meet the spec. I feel like it's worth looking at and maybe someone else can shorten it a bit though (64 characters, 37 numerals, 27 non-numerals).  To compile it, you'll have to use clang and with -fms-extensions.
main(){puts((__int128[]){671944380693508453879479574226248i8});}

Compound literals, is the name for what you're looking for. I'm trying to use them to get this down to 21 characters now!

The lowest non-numeric count I can reach is 26, by making i global (omitting int). Using long can save commas, but costs more. 21 is very far.

Yeah, it's a lot of wasted space.  Using that little trick, I can get it to main(){puts((int[]){1819043144,1870078063,560229490,8481});} but that's still 60 characters.  If I could eliminate just a few more...  Edit: wow, so globals don't have to have a declaration?  Who knew?

@vmrob, globals have to have a declaration. But the type defaults to int, so a; is equivalent to int a;.

@ugoren I knew that they had to have a declaration, I just didn't realize it defaulted to int!

sh, 55
echo Hello world!!! #1234567890123456789012345678901234

Korn Shell, 21
echo $0
#123456789012

The script must be called "Hello world!!!" :)

Python
print'092020090920200948656c6c6f20776f726c642121212009200909200920'.decode('hex').strip()

digits : 55
non digits: 34

Note there are no comments in the solution. only code.

PHP (55 bytes)
This program uses binary (wow, it's the third time I reuse the same trick). 21 non-numeric characters, 34 numeric characters. No letters, because letters are boring.
xxd
0000000: 3c3f 3d7e b79a 9393 90df 8890 8d93 9bde  <?=~............
0000010: dede f53b 2331 3233 3435 3637 3839 3031  ...;#12345678901
0000020: 3233 3435 3637 3839 3031 3233 3435 3637  2345678901234567
0000030: 3839 3031 3233 34                        8901234

@JanDvorak: I'm almost sure I read "before or after". Oh well, let me fix it then.

Mathematica 55
"Hello World!!!"(34+21!)/000000000051090942171709440034

Output
Hello World!!!

Sclipting (34 characters)
丟0000000000긒괡뉆롲닷댠닶롬뉔밈0000000000併0反

Unfortunately Sclipting doesn’t use any ASCII characters at all, so I have to pad the program with 21 useless number characters :(

Bash, 2 chars
Very well, in the unlikely case Robert's answer is not disqualified, here's mine:
$0

Name the file echo Hello world!!! and execute with sh.

Just for reference these types of answers are not allowed by this loophole, however it predates the creation of the loophole so us moderators will not be accepting flags to delete it right now.

@GrainGhost it was a tongue in cheek answer anyways! But it goes to show how much side channels matter sometimes.

Vyxal Ṫ, 8+13=21 bytes
kh6⁽NV33C3ẋ#123456789

kh6⁽NV = Hello world
33C = ASCII 33 to !
3ẋ = repeat top of stack three times
(Note that 33C3ẋ is one non numeric less than literal !!! would be)
Try it Online!

Yeah unfortunately I can’t seem to get the string with only 5 non-numeric chars

J (55 characters)
(34 numeric + 21 non-numeric)
(72 101 108 108 111 32 119 111 114 108 100{a.), 3#33{a.

Forth or Ruby, 55
(34 numeric + 21 non-numeric)
Forth
." Hello world!!!" \ 3141592653589793238462643383279502

Ruby
puts"Hello world!!!"#3141592653589793238462643383279502

Using comments to pad feels dirty, but those are valid answers.

APL, 55 bytes
14↑'Hello world!!!!!!!11111111111111111111111111111111'

C#, 233 Bytes
233 Characters
144 Numeric
89 Non-Numeric Characters
/*I suck at CodeGolf!!!*/new List<int>{0072,00101,000108,000108,000111,0000032,00000119,00000111,0000000000114,0000000000108,00000000000000100,00000000000000033,00000000000000033,00000000000000033}.ForEach(c=>Console.Write((char)c));

Outputs:
Hello world!!!

Japt, 55 bytes
"aaaaaaa1234567890123456789012345678901234"`HÁM WŽld!!!

Try it online!
It is basically a simple hello world with some rubbish at the beginning that is ignored but makes the code satisfy the conditions.

Pxem, Numeric: 34 bytes + Non-numeric: 21 bytes = 55 bytes.

Filename: Hello world!!!.pxxxxx1234567890123456789012345678901234
Content: empty

The boring answer. The stupid latter part is nothing but a garbage.
Try it online!

Python 3.11, 34+21=55 bytes
Boring answer, uses comments to store extra junk.
print("Hello world!!!")#abcdef12345678901234567890123456

Windows Batch
echo Hello World!!!::0123456789012345678901234567890123

Wow. This is so much different from my sh solution.


text:
Quine with prime sourcecode character distribution constraints

Your program should take no input, and no network or other connections.
Your program should output it's sourcecode.
The sourcecode must consist of 3 types of characters: Numeric (0-9), Alpha (a-z|A-Z) and symbols !(0-9|a-z|A-Z). Constraints for the distribution of characters is:

3.1. Every neighbouring characters with equal character-type makes a character-group.
3.2. Each character-group length in bytes must be a prime-number (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ...)
3.3. The total number of character-groups of each character-type must be a neighbouring (but not equal) fibonacci sequence number. For example: 3 groups of numbers, 5 groups of alpha, 8 groups of symbols.
3.4. A character-group of one charater-type cannot be adjacent to another character-group of the same character-type, because that will create one bigger group instead.

Example valid sourcecode (regarding character distribution, it does however not output it's sourcecode):
"."."."aa321'","/hithere' 12345678901,.,.,12345,.,

Character distribution in the example: 2 groups of Alpha. 3 group of numeric. 5 groups of other characters. The numbers 2, 3 and 5 are neighbouring numbers in the fibonacci sequence.
This is code-golf, good luck have fun!

You might want to disallow trivial solutions like any numeric literal in golfscript before it's too late.

I believe the somewhat boring quine 12 would be legal in J, GolfScript, etc under these rules (2 being a prime number and 1 being a fibonacci number).

The sourcecode must consist of all 3 types of characters, so it is atleast 6 character-groups

neighbours in the fibonacci sequence

so, 0 doesn't count as a fibonacci number?

It does, but the code must contain all three types of characters. So rule 3 invalidates 0 groups of one character-type.

Oh, I see, "Your source code must consist of 3 types of characters". I read that as a partitioning of the characters rather than a requirement in itself, at first.

do 1 and 1 count as neighbouring fibonacci numbers? Or, are we even allowed to use "neighbouring or equal" character group counts? Also, does 1 count as a prime?

If there is 1 group of any character-type, that is the 1 neighbouring 2 in the fibonacci sequece, so 1 and 1 does not count as neighbouring numbers in the fibonacci sequence in this code-golf. Atleast 6 character-groups. 1 does not count as a prime.

PHP, some other languages - 12 bytes
22ab,,22,,22

PHP will print out the source code if it is not wrapped in some tag.
This is actually the smallest possible answer to the question. The smallest prime number is 2, and the smallest distinct fibonacci numbers are 1, 2, and 3. 3 + 2 + 1 = 6. 6 * 2 = 12
See a run here: http://ideone.com/0NDA8A

Golfscript, 21 15 characters
11{'aa.~' }aa.~

After removing all NOPs, their images, and the leading 11, this becomes the quine
{`'.~'}.~

reading: block(string(dup, eval)); dup; eval.
Now to shoot for the stars (20 characters - the minimum for 2-3-5) or even galaxies (12 characters - the absolute minimum)  I've taken a short stop at Alpha Centauri B to refuel, now I'm drifting through intergalactic medium. Thanks,  Goldbach's conjecture.
Live: http://golfscript.apphb.com/?c=MTF7J2FhLn4nMTE7fWFhLn4K

@Plarsen shaved off six characters. One more to go, then I believe I'll hit the rock bottom for golfscript.

oh man! I could never imagine that was even possible!

Befunge 98 - 16 bytes
<@,*+982aa,,kd$"

This works only if your interpreter interprets line-wrap as adding a single space. This one works otherwise:
<@,*+982aa,,kd "

Character groups:
<@,*+ 5 chars, symbols
982   3 chars, numbers
aa    2 chars, alpha
,,    2 chars, symbols
kd    2 chars, alpha
$"    2 chars, symbols

So the fibonacci numbers are 1 (numbers), 2 (alpha), and 3 (symbols)

Windows Command Script - 12 bytes (+ free folder bonus)
md  12##56##

Since every command is echoed by default, it's just a matter of finding the shortest command.