It just seems like Eliza!
There is a story behind every contest win! I am sharing some of my experiences before I forget them :), hoping it would inspire some students. #conteststories
25th - 27th Feb 1993: I was doing my second year Engineering (Sophomore year) at GCT, Coimbatore. I loved taking part in competitions, primarily because I liked challenges, and I wanted to see how I fared against bright people from all around the country. I did quite well, but I must also admit I had an unfair advantage - I started programming very early, around 9th grade, while many of my peers only started during college.
One of the prestigious events was the one conducted by Anna University (College of Engineering, Guindy), called Abacus, in Chennai. I said prestigious because it was the #1 institution in the state apart from the IITs.
I signed up for two contests - 1) Impromptu software contest, where you are given a specific time to build something that works, and 2) Software demo contest, where you demonstrate software that you had built earlier, in front of a large audience.
When I read the problem statement for the impromptu software contest, I was a bit flummoxed. It just read:
Just a one-liner! Such a simple statement, but so difficult to implement properly, and it has to be done within 2 hours! How do you write something like that? I thought. It seemed clear they are looking for participants to think broadly and come up with something that works reasonably well (If you were given this problem, what would you do? Comment below. I would love to know!).
I was pondering what to do, and something that I had read about popped into my mind. It was Eliza - the first AI chatbot! I had read that even though it was a very simple implementation, it tricked people into thinking they were interacting with a Psychiatrist. Here is a screenshot of an Eliza implementation:
So I thought, maybe I should make something like Eliza. I really didn't know about the specifics of what questions it asked, responded to, and how it was implemented, etc., but in the back of my mind, I thought it should be something like Eliza.
At that time, my language of choice was Turbo Pascal. I had started off with BASIC, and picked up some Z-80 Assembly, tinkering with my home computer. However, I fell in love with Pascal when a friend of mine brought me a floppy loaded with Turbo Pascal 3.0. I was so happy to be able to generate a .COM file (executable) that I can pass on to my friends. They could just run it without a need to have a compiler or interpreter! When you go to a competition, they would provide a PC with a few languages pre-loaded. Turbo Pascal was one of the choices almost everywhere.
I started off by tokenizing the input, i.e., breaking down the sentence into words. Then I remember making a crude attempt to identify the sentence structure, noun, verbs, etc. I was just looking for keywords such as "name", "how are you" etc., and crafted generic responses. This approach is fine for some introductory conversation, but the challenge was how to make a prolonged conversation. It occurred to me that taking them to a game would make it go longer. But what game shall I make?
Have you played the number guessing game? I would ask you to guess a number between 1 and 100. I will then ask you if it is greater than 50. If you say yes, then I will ask if it is greater than 75. If you say no, I will ask if it is greater than 62. You get the idea. It is basically a binary search to find the number within 7 attempts. I think I programmed two such games. I forgot what the other one was.
After 2 hours, it was judgment time, and the judge visited my station and she started typing:
领英推荐
My code replied
She then typed,
I forgot her actual name, so I have put xyz instead above. My code replied:
Did you notice the name replacement? She then typed,
My code replied:
At this point, she exclaimed, "It just seems like Eliza!". Yes! It was exactly what I wanted! I knew at that moment I was going to win. She then went on to play the guessing game, then quizzed me if I knew about Eliza. I sheepishly admitted that I did and that I wanted to program something similar for the contest.
The Verdict
I won the first prize. I am not sure how much I won, but during those times, the prize money for 1st place was typically Rs. 750 or Rs. 500, which was a lot for me :)
I mentioned I also took part in another contest in the same event - The software contest. Do you want to know what happened? Comment below!
Founder - Expertrec search engine, ex-Googler
3 年thanks for sharing this raj, very inspirational. And, congrats for winning!
Quantitative Engineer at Goldman Sachs
3 年So so cool, and what a thrill!
Engineer at Micron | Alumnus of GCT
3 年Looking forward to know about software contest !
Principal Platform Performance Architect (PMTS) (Software)
3 年Raj Madhuram Good experience indeed what you had and I used to work on Turbo Pascal back in '90 then COBOL and Pro*C, but similarly not to your sophisticated Eliza, we as a group wrote a program on LISP programming back in '91 as an experimental. Worked to an extent. ?? Good old days.
Poet on terminals compiling dreams.
3 年? I wrote C++ application as HTML blog maker with built-in FTP-client to host it to freeorg type of hosting services. Took inspiration from BlueVoda and tried to made blog writing software as .EXE. ? Had 5 built-in themes to choose & XML theme designer. ? Program: BSP Inter-school Competition & year was 2011/12. Won 1st prize with team — such the amazing innocent memories. Thank you for your post, just revisited those older good times! PS: Why this Kolavari Di was just released and was in the ears for most of time with Linkin Park` The Catalyst.