| | 1 | <html><head><meta name="generator" content="Help & Manual 2.7.0"><title>GiveToAskFor</title></head> |
| | 2 | <body bgcolor="#FFFFFF"> |
| | 3 | <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#C0C0C0"><tr><td
align="left"> |
| | 4 | <font face="Arial" size="3" color="#000000"><b>GiveToAskFor |
| | 5 | <br> |
| | 6 | </b></font> |
| | 7 | |
| | 8 | </td><td align="right"><font face="Arial" size="2"><a href="tcommand.htm">[Previous]</a>
<a href="introduction.htm">[Main]</a></font></td></tr></table><br> |
| | 9 | |
| | 10 | <font face="Arial" size="2" color="#000000">GiveToAskFor provides, in a somewhat limited way, the means to translate
commands like: |
| | 11 | <br> |
| | 12 | |
| | 13 | <br> |
| | 14 | <b>>bob, give me the gold |
| | 15 | <br> |
| | 16 | </b> |
| | 17 | <br> |
| | 18 | into |
| | 19 | <br> |
| | 20 | |
| | 21 | <br> |
| | 22 | <b>>ask bob for the gold |
| | 23 | <br> |
| | 24 | </b> |
| | 25 | <br> |
| | 26 | It does this by defining a StringPreparser that simply looks for input of the form "X, GIVE ME Y" and transforms it into "ASK X FOR Y". This
may have odd effects if Y is not simply the name of an object or topic that can occur in an ASK FOR command. For example, if the player typed: |
| | 27 | <br> |
| | 28 | |
| | 29 | <br> |
| | 30 | <b>>bob, give me the coin, then go north</b> |
| | 31 | <br> |
| | 32 | |
| | 33 | <br> |
| | 34 | The input would be translated into |
| | 35 | <br> |
| | 36 | |
| | 37 | <br> |
| | 38 | <b>>ask bob for the coin, then go north |
| | 39 | <br> |
| | 40 | |
| | 41 | <br> |
| | 42 | </b>Which would not mean the same thing. The moral is that the mechanism this module employs is somewhat fragile, and should be used only at your
risk.<b> |
| | 43 | <br> |
| | 44 | </b> |
| | 45 | <br> |
| | 46 | To use GiveToAskFor simply include GiveToAskFor.t in the list of source files in your project makefile. |
| | 47 | <br> |
| | 48 | </font> |
| | 49 | |
| | 50 | </body></html> |