Sunday, October 21, 2007

Love calculator

I know we're all in the thick of assignments (damn Software Engineering), but here's some light relief and a way to pass time.

A few months back, I created a program which takes in 2 names and spits out a number for my programming/algorithm study. It's not the most interesting thing on earth, but it cost me a fair bit of my life doing it. Once I got to the part on input/output in programming, I decided to change the code a bit to allow end user input. Reading a manual (yes, its a manual, not a textbook. Go figure), I finally learnt how to make an executable!

Slight background here: I'm learning a language called Scheme, which is a dialect of LISP (yes, even programming languages have dialects!) for my first year programming. Unlike most places, we don't use "normal" languages like C, Java etc. Scheme was developed at MIT, and they still use it as their introductory programming subject. There are pro's and con's to using such a "interesting" subject, which is a whole topic in itself.

Anyway, I've knocked up a program that takes in 2 names, and calculates the "love-compatablity" between the 2 of them. My algorithm, if anyone is interested, is as such:

If the number of occurrences of the character is odd, the value is 50 plus the ascii value of the character (hint: use the predefined scheme procedure char->integer
to get the ascii value of a character). If the number of occurrences is even, the value is the ascii value of the character. If there are no occurrences of the character, then the value is zero
I suppose it should be a good idea to add a disclaimer now: this is purely random. It is no more accurate than those SMS love calculators you see online and anywhere else. In a way, this is the more "high-tech" version of the "love" game some of us might have played in Secondary school. Y'know, taking the names of two people and see how compatible they are by the number of letters they share................

The program isn't the most user friendly one out there, but it is not supposed to. We learn how to create programs, not MAKE programs. Subtle but important differences there. Some people get confused with the "input first name" prompt. It doesn't mean YOUR first name (like mine is Timothy). It just means input name n0 1. If that makes sense.

After I passed finished it and did all the documentation, I decided to put in a few names, just to see what I'd get:


Oudou faction 4 ever!


Nooooooooooooooooooooooo! This can't be happening!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Surprisingly, it can be accurate.


Damn true.


I swear, this is random! I did not rig the results in anyway!


Repeat after me: T-H-I-S I-S R-A-N-D-O-M.


It isn't as daft as it sounds.


But SQ doesn't want my money!


Never has a program by a 1st year student been so accurate.



I love MH. And SQ. And NZ. And QF. And........................

And some more:
Image Hosted by ImageShack.us

LEGAL DISCLAIMER: BY CLICKING ON THE DOWNLOAD LINK, YOU AGREE TO THIS TERMS AND CONDITIONS. I, TIMOTHY, WILL NOT BE RESPONSIBLE FOR ANYTHING THAT HAPPENS IN THE USAGE OF THIS PROGRAM. THIS INCLUDES, BUT NOT LIMITED TO, RELATIONSHIP BREAKUPS, DIVORCE, BANKRUPTCY AND HEARTBREAK. PLEASE DO NOT MAKE ANY DECISIONS WHATSOEVER BASED ON THIS PROGRAM. THIS IS PURELY FOR FUN AND HAS NO SCIENTIFIC BASIS WHATSOEVER.

Anyway, the program is downloadable here. Its a 3.3 MB zip file. You have to extract all the files properly in order to run love-match-test.exe. Make sure that all the DLL's are in the /lib subfolder. Easiest way is to use WinZip to extract the files. Hosting thanks to Ian.

Have fun!

1 comment:

Anonymous said...

Ian & Tsuruya: 0

How I rolled on the floor.