Beefy Boxes and Bandwidth Generously Provided by pair Networks
"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,
Ovid

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
in thread What was your first program? by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found