Wish Yourself a Happy New Year
Well, before you do that, I will do it from my side:
Happy new year to you!
So, I was just working on somethings, and found this nice little code snippet that was totally appropriate for this event.
If you are a fan of the ruby (like me), define a function with the following
definition (try, using
irb for this purpose):
The above function does the following:
- accept a string as an input
- break it into its constituent characters
- convert these characters to their ascii integer value
- sum up all the integer values and return that sum
Nothin’ great about that function, right?
Now, try this in your
You will see that the above function is quite intelligent in itself.
That little function is empowered with an artificial intelligence by its code, without any complex mechanisms :)
Oh, and here is an alternative:
If you are a python fan, instead, try this: