</2008> <2009>

First things first, Happy new year one and all.

It’d be almost sinful if a programming blog doesn’t start with a “Hello World!”.
Oh That’s but a cliche, right?
Wrong.
Not if you use exotic languages, I say.
How about a “Hello World!” in one of the smallest Turing complete language, Brainfuck?

+++++ +++++             initialize counter (cell #0) to 10
[                       use loop to set the next four cells to 70/100/30/10
    > +++++ ++              add  7 to cell #1
    > +++++ +++++           add 10 to cell #2
    > +++                   add  3 to cell #3
    > +                     add  1 to cell #4
    <<<< -                  decrement counter (cell #0)
]
> ++ .                  print 'H'
> + .                   print 'e'
+++++ ++ .              print 'l'
.                       print 'l'
+++ .                   print 'o'
> ++ .                  print ' '
<< +++++ +++++ +++++ .  print 'W'
> .                     print 'o'
+++ .                   print 'r'
----- - .               print 'l'
----- --- .             print 'd'
> + .                   print '!'
> .                     print '\n'

Neat, isn’t it? 😉

Or How about a “Hello World!” Program a la curve fitting?
Like this one.. Huh Huh??


from math import *

 def f(x):
     return int(round(96.75 + -21.98*cos(x*1.118) + 13.29*sin(x*1.118)\
         + -8.387*cos(2*x*1.118)\
         + 17.94*sin(2*x*1.118)  + 1.265*cos(3*x*1.118)  + 16.58*sin(3*x*1.118)\
         + 3.988*cos(4*x*1.118)  + 8.463*sin(4*x*1.118)  + 0.3583*cos(5*x*1.118)\
         + 5.878*sin(5*x*1.118)))

 print "".join([chr(f(x)) for  x in range(12)])

Why use a programming language to just ‘display’ a stupid string you say?
I hear ye, people. I hear ye.

Let’s leave that to Latex.
Here, a Hello World display program in Latex –

\documentclass{article}

\begin{document}
Hello world!
\end{document}

See Y’all later again with something worthwhile 🙂

Niranjan Nagaraju

I am Vini – Vini The Pooh aka Niranjan. I am a little “sheep in the big city”. A self-proclaimed atheist, freelance writer and cartoonist; The latter two are an avocation as yet, but I believe they really are my medium. Oh, and I code for a living. :)

3 Comments:

  1. Hmmm the lil nerdlet has come up with another programmin blog!! Great!!! Kudos to the lil Nerdlet 🙂

  2. There ought to be a limit to how many blogs can be created..

Leave a Reply

Your email address will not be published. Required fields are marked *