Commit graph

386 commits

Author SHA1 Message Date
Eric S. Raymond
87c6d3fb1e Canonicalize OV commands to VO form.
Allows us to get rid of some obscure logic that causes an unnecessary
word shift. One error message changes in a benign way.
2017-08-03 15:02:41 -04:00
Eric S. Raymond
cfa37c83a7 Massage "{oil|water} {plant|door} into equivalent pourcommand.
Bedfore this change the command was passed in OV form, which we want
to get rid of.
2017-08-03 14:48:44 -04:00
Eric S. Raymond
0468da2cdf Simplify overcomplicated code. 2017-08-03 14:22:38 -04:00
Eric S. Raymond
2d618410b8 More breadcrumb improvements. 2017-08-03 12:56:50 -04:00
Eric S. Raymond
8b1533db1a Improve debugging. 2017-08-03 12:25:56 -04:00
Jason S. Ninneman
24d102781c Typedefify command_t; simplify code accordingly. 2017-08-03 08:29:46 -07:00
Jason S. Ninneman
5c30d6429f Simplify command word handling. 2017-08-03 08:24:18 -07:00
Jason S. Ninneman
5c91ea3739 Encapsulate command words into their own struct. 2017-08-03 08:24:18 -07:00
Eric S. Raymond
812d0194bb Add breadcrumbs for grammar debugging. 2017-08-03 10:54:33 -04:00
Eric S. Raymond
fd4e3aea6a Address GitLab issue #36: "Get what?" prompt incorrectly handled 2017-08-01 18:37:58 -04:00
Eric S. Raymond
878efdddfb Remove unnecessary clearing of command verb. 2017-07-31 17:40:25 -04:00
Eric S. Raymond
5d6b3aaf62 Fix a coverage gap. 2017-07-31 14:59:58 -04:00
Aaron Traas
ca5374edc3 Modified action() to take take a copy of command rather than a pointer.
It should be safer now that we're not scribbling all over command in
action(), as it's closer to pure. Also fixed a bug in say.
2017-07-21 18:27:02 -04:00
Aaron Traas
e8a627f964 Specials excised from adventure.yaml 2017-07-21 17:15:23 -04:00
Aaron Traas
5337e00725 Fix to Gitlab issue #32. Now SEED and WASTE are in adventure.yaml
NOTE: the tests are all updated because now, like every other action,
SEED and WASTE have a \n before their output, as they correctly use
SPEAK
2017-07-21 10:23:02 -04:00
Eric S. Raymond
a3c159660b Comment cleanup, semantic types, information hiding. 2017-07-21 07:38:09 -04:00
Eric S. Raymond
609159ad6d Abolish as many undifferentiated long variables as possible.
Simple counter become ints.
2017-07-20 18:49:08 -04:00
Aaron Traas
a167945e19 Information hiding - moved all of command input parsing to misc.c
get_command_input() is effectively an I/O function that takes raw input
and makes it into a command_t. With other I/O functions, it belongs in
misc.c.

This alos allowed me to make 4 other functions static, as they were only
called by get_command_input();
2017-07-20 16:02:54 -04:00
Eric S. Raymond
342994376a Address GitLab issue #28: Advent hangs on some inputs 2017-07-20 12:24:02 -04:00
Eric S. Raymond
5701a777c6 Remove unused variables. 2017-07-20 10:53:15 -04:00
Eric S. Raymond
2fa530340d No more packing in the parser.
As a side effect, ill-formed input consisting of "_\n" gives
a slighty better error message.
2017-07-20 10:17:56 -04:00
Eric S. Raymond
78ba0fac6a Remove unneeded vocabulary lookup. 2017-07-20 10:13:15 -04:00
Eric S. Raymond
4e01669e06 Remove special-case code that was inducing bugs. 2017-07-20 09:08:10 -04:00
Eric S. Raymond
3f90f5bf38 Improved word type checking. 2017-07-20 07:40:19 -04:00
Eric S. Raymond
52723acb72 Eliminate some uses of wd2 - tests can be done on raw2 buffer instead. 2017-07-20 07:09:20 -04:00
Eric S. Raymond
360adc8bfb Add some word-type checking where it's needed. 2017-07-20 07:02:35 -04:00
NHOrus
30822d0ba4 No magic, revert some experimental changes in pipeline 2017-07-17 13:56:52 -04:00
Eric S. Raymond
a4c1737428 Remove flawed code to drop batteries. 2017-07-17 07:29:44 -04:00
Eric S. Raymond
992bdbf16c Cover MISSING_BATTERIES in a test. Needs unducumented "waste" fallback. 2017-07-17 06:07:01 -04:00
NHOrus
614d9b34ad Removed temporary variable for clarity; Upsized text buffer in fallback to maximum possible size 2017-07-16 16:07:23 +03:00
NHOrus
8d9c8e4d5c Deal with more agressive gcov 7.1; Reindent 2017-07-16 16:00:19 +03:00
Eric S. Raymond
8bce57d3df Fix bug where knife hit might not be reported. 2017-07-16 07:13:06 -04:00
Eric S. Raymond
9b585f40d8 Two coverage imprivenents, one by recognizing dead code. 2017-07-16 05:33:43 -04:00
Eric S. Raymond
fece880dc2 Documentation polishing. 2017-07-15 12:05:54 -04:00
Eric S. Raymond
1954c04ccc Fix off-by-two bug. 2017-07-14 12:39:06 -04:00
Jason S. Ninneman
11043b7246 Replace some uses of wd[12] with id[12]. 2017-07-14 09:18:55 -07:00
Jason S. Ninneman
ff6a816e5f Handle word type and raw strings. 2017-07-14 09:18:55 -07:00
Jason S. Ninneman
820737fb80 Use vocab IDs along side packed words. 2017-07-14 09:18:24 -07:00
Aaron Traas
e696fed6db Prompt and taunt you after 3rd and final death
Fixed a bug where you'd not be asked about whether to be resurrected a
final time. Now you are.
2017-07-13 21:52:27 -04:00
NHOrus
49d9ef1bee No spk remains in the code base 2017-07-13 21:52:27 -04:00
NHOrus
03b2f1c86e Removed unused code, reindented 2017-07-13 21:52:27 -04:00
Jason S. Ninneman
50efa22849 Express word type with an enum instead of magic numbers.
* Make a cleaner function for getting vocab metadata.
* Get rid of magic numbers.
* Purge get_vocab_id().
* Abolish the *_WORD() macros.
* Add FIXME comment on some ugliness.
2017-07-12 10:35:00 -07:00
Jason S. Ninneman
b5e8eec80e Replace tests on packed words with tests on strings. 2017-07-11 23:14:38 +00:00
Eric S. Raymond
3a722da650 Minor coverage inclusion. 2017-07-11 11:57:46 -04:00
Eric S. Raymond
00cf2a9373 Comment polishing. 2017-07-11 04:15:57 -04:00
Eric S. Raymond
de3be760b6 Comment polishing. 2017-07-11 03:43:37 -04:00
Eric S. Raymond
96950869c6 Reindent. 2017-07-11 03:26:00 -04:00
Aaron Traas
12b2ff74f6 Cleanups and clarifications in do_command() 2017-07-10 17:43:59 -04:00
Aaron Traas
9056fa7a2c Eliminated another label 2017-07-10 17:35:24 -04:00
Aaron Traas
18ec2f79b0 Eliminated a label 2017-07-10 17:23:20 -04:00