Commit graph

74 commits

Author SHA1 Message Date
Eric S. Raymond
c88f981387 Flush log on interrupt, just for convenience. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
adeb54f6cb Case correction. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
a2dc58de8d Death by dwarf test. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
d96c66ac36 Fix bug that led to comments bnot being ignored. 2017-06-13 20:43:41 +03:00
NHOrus
b11fcf07e3 Different, correct fix of tests
Now without caching .data and extended cleanup
2017-06-13 20:43:41 +03:00
Eric S. Raymond
6ef28931b3 Document test comment format. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
0507307a32 Regression-test machinery is now documented. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
75c8df9225 First version of regression tests.
Only one test so far but the framework for more is in place.
2017-06-13 20:43:41 +03:00
Eric S. Raymond
d9d2629854 Repeatable seeding is working. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
ff467f276b Implement fallback handler that looks at the raw command buffer.
With database cinpilation not broken this time...
2017-06-13 20:43:41 +03:00
Eric S. Raymond
a408da3fed Repair CentOS 6 build (fails due to clock_gettime() being undefined)
GitLab issue #2.
2017-06-13 20:43:41 +03:00
Jason S. Ninneman
000b97ff11 Stop command-logging from non-stdin sources. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
341bf61139 Once again, take srand()/random() out of the initialization chain.
They have exactly the wrong kind of randomness for this job - not
returning consistent sequences across different platforms or C library
versions, and because pseodorandom not really better than sampling
the clock.
2017-06-13 20:43:41 +03:00
Eric S. Raymond
4d50cce210 Re-enable skipping of #-led comments. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
eb91f49dd5 Reapply "Clean up logic for exiting input loop and scoring." 2017-06-13 20:43:41 +03:00
Jason S. Ninneman
cd0e90bdb4 Remove disused label. 2017-06-13 20:43:41 +03:00
Eric S. Raymond
793c3fa1a4 Remove cached data on clean.
We've had two instances now of database compilation getting silently
broken and that not noticed because of the caching. Attempt to
forestall this.
2017-06-13 20:43:41 +03:00
Eric S. Raymond
06795f691f Revert SEED handling and comment orocessing. It broke database compilation.
This code is remarkably like the game it implements - a maze of twisty
little FORTRANisms, all alike.  Very easy to get lost.
2017-06-13 20:43:41 +03:00
Eric S. Raymond
bd64a4ceda Take srand()/rand() out of the initialization chain...
...they're not guatanteed to produce consistent across platforms or
libc versions.
2017-06-13 20:43:41 +03:00
Eric S. Raymond
9ef91255bc Clean up logic for exiting input loop and scoring. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
9407cd7bc3 Allow comments in logfiles. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
016bcf2ff2 Seed command fully implemented but apparently buggy.
Dwarf appearance is not yet reproducible.
2017-06-13 20:43:40 +03:00
Eric S. Raymond
1c4150055a Implement stub handler for SEED command. Not hooked up to PRNG yet. 2017-06-13 20:43:40 +03:00
Jason S. Ninneman
ebfa184a6c Remove a bad use of tv_nsec. 2017-06-13 20:43:40 +03:00
Jason S. Ninneman
8d97eb71ff Move a line that got out of place. 2017-06-13 20:43:40 +03:00
Jason S. Ninneman
24f327cc09 Add seedable PRNG using an adaptation the original LCG algorithm. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
b0a3c821e9 Fix the slightly broken prompt test. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
aa7e291bc6 Revert structurization changes, they broke database compilation...
...bug showing only if adventure.data was absent.  We'll need to sneak up
on this more carefully.
2017-06-13 20:43:40 +03:00
Eric S. Raymond
6b97463cd5 More switch reformatting. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
dd25a9f3f1 Reformat a switch statement for readability. No logic changes. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
3f57114791 Revert a variable name previously changed to be out of the way.
Also, make output from replays easier to interpret by adding prompts.
2017-06-13 20:43:40 +03:00
Eric S. Raymond
ba7561a27a More structurization. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
ac14bf8ae9 Echo commands to stdout when replaying...
...makes check loads full transcripts abd more readable.
2017-06-13 20:43:40 +03:00
Eric S. Raymond
bef99090db More globals to the game structure. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
4f0e04404e More global-to-structure moves. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
485ca59432 More comment cleanup. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
f8dc7dbdf1 Fixed case in a comment. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
cb477da7ec Move more globals into the state structure. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
91bfd55c1c Begin gathering saveable game state into a structure. Not yet complete.
No logic changes.  A bunch of globals turn into fields (with the same names
except for lowercasing) in struct game_t.

Eventually this will allow drastic simplification of the save/load logic.
2017-06-13 20:43:40 +03:00
Eric S. Raymond
ec4c0c8cd0 Input source is parametrized all the way down.
This means that, potentially, do_command() could be called on any text file
pointer and the right thing would happen.
2017-06-13 20:43:40 +03:00
Eric S. Raymond
00321f3388 Begin factoring out the command interpreter. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
e512d15232 Documentation polishing. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
5605ccba4c Update for TODO items accomplished. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
e7f4d6125b Fix command synopsis on the manual page. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
0ad8d13f27 Added oldstyle option. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
c16e4cb078 Fix capitalization glitches. 2017-06-13 20:43:40 +03:00
Eric S. Raymond
0eda56fae9 Add -l option to enable command logging. 2017-06-13 20:43:40 +03:00
Jason S. Ninneman
c00601788e Fix typos in the history. 2017-06-13 20:43:39 +03:00
Jason S. Ninneman
5386a9ac27 Fix a couple typos. 2017-06-13 20:43:39 +03:00
Eric S. Raymond
42e6e7cdb7 Fix strange inside-out organization of the input routines.
Seems to have nbben a result of FORTRAN not having anything like a
stream object that can be passed around.

A step towards logging and log replay.
2017-06-13 20:43:39 +03:00