"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I remember writing one of those adventure games, too! The only problem was that I didn't want to be stuck with a simple two-word command. I wanted full "Zork sentence" capability. My program would scan through the input and take the first three letters of every word (limited memory) and match those up with the words in DATA statements. My test sentence (my dog, I remember it after 15 years!) was "hit the skeleton with the sword, take his ring and then walk north and touch the altar." It took 8 seconds for the BASIC program to parse that into numbers. Then, the program would branch to various parts of the program when it had a "verb" number and apply the action (if possible) to the "noun" number.
Since 8 seconds was too long for the program to parse the input string, I tought myself a little 8088 assembler and rewrote the routine in about a week. My goal was to get the program to start recognizing adjectives and compound-complex sentences, but then my roommate moved and took his computer with him. I didn't touch a computer again for another 9 years. It's good to be back :)
Cheers, Join the Perlmonks Setiathome Group or just go the the link and check out our stats. In reply to (Ovid) RE(2): What was your first program?
by Ovid
|
|