@WWWWolf said:
@PeriSoft said: Personally, I'd favor curve-fitting a polynomial to a sequence of the ASCII values of 'HELLO WORLD', and writing a BASIC routine:
10 FOR N = 1 TO 11
20 PRINT CHR$(equation based on N)
30 NEXT N
...now THAT'S ninja.
BASIC? That's more of a pirate thing. (11-year-old warez d00d pirate, that is.) Ninjas use C. =)
Edit - some more details. I actually did this years same thing years ago, using GNU Octave's polyfit function. I wanted to do the program in Fortran for silliness, but, er, I have no idea why the program didn't work. (Apparently Fortran thinks of numbers in some strange way I don't understand.) So, I did it again in plain old C. I think the git repo includes a plot too - I was able to fit "Hello world" (with capital H), but adding punctuation to the end fucked everything up. It's past midnight, I don't have enough coffee to remember more and CommunityWTFServer will probably refuse to edit this comment if I keep on rambling for hours anyway.
Oh, and doubles. As a C programmer you should know that doubles (or other floats) are slower to compute than integers (in most cases). NINJAS USE NUMBER THEORY. Below's my attempt (in JavaScript):
var a=[51,4,26,51,15,63,7,64,73,33,37,50,40],b=0,c,d,e='';
for(;b<13;b++)
{
for(c=d=0;d<13;d++)
c=(c*b+a[d])%89;
e+=String.fromCharCode(c+32);
}
print(e);
If you like, replace print with alert.