Commit graph

51 commits

Author SHA1 Message Date
Eric S. Raymond
ffa9332ee3 Avoid noise diffs around logging of seed command. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
bed5fb747b Don't loop back on resume file read failure...
...it's inconvenient for testing.
2023-03-23 11:28:53 -04:00
Eric S. Raymond
0a63b5e2d6 Trim resume file names as required. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
c3bb0dae75 Quiet down database compilation. Observe RNG stability.
At this commit, we can tell that the seeded-RNG nehavopr of this 430
branch is identical to that of master because the axebear log - which
includes randomization of dwarf spawning and the reservoir word -
yields the same results in both versions.
2023-03-23 11:28:53 -04:00
Eric S. Raymond
184e981be3 Fix things so seed doesn't cost clock time. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
b80d1779e6 Fix dropped stitch in last commit. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
220cf2c58b Make it possible to pass options to advent from within regression-test loads. 2023-03-23 11:28:53 -04:00
Jason S. Ninneman
c41dd35268 Ensure the ZZZZ magic word is reproducible.
This happens by making the SEED command also regenerate the magic word.
2023-03-23 11:28:53 -04:00
Eric S. Raymond
d39325f963 Fix bug that led to comments not being ignored. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
85cd6b0bd5 Repeatable seeding is working. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
f286c3a327 Implement fallback handler that looks at the raw command buffer. 2023-03-23 11:28:53 -04:00
Jason S. Ninneman
74dc437a7e Stop command-logging from non-stdin sources. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
2fdd509f32 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.
2023-03-23 11:28:53 -04:00
Eric S. Raymond
54afefba94 Re-enable skipping of #-led comments. 2023-03-23 11:28:53 -04:00
Jason S. Ninneman
060601da2f Remove a bad use of tv_nsec. 2023-03-23 11:28:53 -04:00
Jason S. Ninneman
5598b7a178 Add seedable PRNG using an adaptation the original LCG algorithm. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
97b00dfb14 Make output from replays easier to interpret by adding prompts. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
63efff14f5 Echo commands to stdout when replaying...
...makes check loads full transcripts abd more readable.
2023-03-23 11:28:53 -04:00
Eric S. Raymond
a416d78a58 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.
2023-03-23 11:28:53 -04:00
Eric S. Raymond
baa508a683 Begin factoring out the command interpreter. 2023-03-23 11:28:53 -04:00
Eric S. Raymond
12f909bcc9 Start advent430 branch for correctness testing.
The purpose of this branch is to create a version of the game from
before the bug fixes, refactoring, and logic changes.  We want this so
we can run it against our 100% coverage test suite and see all changes
in behavior.

This branch is forked from the point where the prompt and the oldstyle
option were added.  At this point there had been only two logic
changes:

1. Do initialization of the LCG with gettimeofday(). Note that
this change will not affectt regression testing, since the
initialization done in this way will nbe overridden in the
logs by seed commands.

2. Refactor the input routines to a normal Unixy organization.
This is required for the -l option to work.

This commit just builds the binary at advent430 where it
won't collide with the production version.
2023-03-23 11:28:53 -04:00
Eric S. Raymond
935d8b8e68 Added oldstyle option. 2017-05-23 11:28:56 -04:00
Eric S. Raymond
f89f63c6d1 Fix capitalization glitches. 2017-05-23 09:18:28 -04:00
Eric S. Raymond
943b3a62e6 Add -l option to enable command logging. 2017-05-23 08:57:35 -04:00
Jason S. Ninneman
9bcbe342a4 Fix typos in the history. 2017-05-22 23:13:28 -07:00
Jason S. Ninneman
c250cfc6a9 Fix a couple typos. 2017-05-22 21:13:15 -07:00
Eric S. Raymond
040f19adde 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-05-22 21:26:14 -04:00
Eric S. Raymond
19b3e3e656 Remove unused labels. 2017-05-22 20:55:21 -04:00
Eric S. Raymond
01b2c05cbb More magic-number elimination. 2017-05-22 20:51:55 -04:00
Eric S. Raymond
5e2ca9a0e4 Don't use a magic number when we can use sizeof(). 2017-05-22 20:33:23 -04:00
Eric S. Raymond
ef24a63ced Prototypization. 2017-05-22 18:47:39 -04:00
Eric S. Raymond
5286f6b3bd Correct long-size bug that resulted in checksum error.
Idea thanks tp Max Ninneman.
2017-05-22 09:30:51 -04:00
Eric S. Raymond
f5831dbf39 Correct history based on code comments. 2017-05-22 09:11:12 -04:00
Eric S. Raymond
18767d52dd Fix up case on all comments to make them more readable. No code changes.
The all-capsing was a FORTRAN remnant.Also, we change a few FORTRANisms
so they are less confusing in this C context; ".TRUE." and ".FALSE." become
"true" and "false", "MOD" is mapped to % in places tha t are like C expressions
and (usually) "modulo" in places that aren't.
2017-05-21 13:12:24 -04:00
Eric S. Raymond
809f53d099 Add TODO items. 2017-05-19 15:16:39 -04:00
Eric S. Raymond
8e86d0dca3 Documentation polishing. Add TODO. 2017-05-19 13:30:12 -04:00
Eric S. Raymond
86b04b682d Prepare to initialize public repository. 2017-05-19 13:22:09 -04:00
Eric S. Raymond
d93746d078 More ANSI prototype conversions. 2017-05-19 01:28:38 -04:00
Eric S. Raymond
9a285402da Document ADVENTURE environment variable. 2017-05-19 00:49:23 -04:00
Eric S. Raymond
17ad4891ee More boolification.
Constants and formals have been converted, but not globals yet.
2017-05-18 17:28:18 -04:00
Eric S. Raymond
23f2dbe814 Replace fDATIME with ANSI/POSIX clock_gettime(). Rip out DOS/AMIGA shims.
The thinking here is that we simplify life by going pure ANSI/POSIX.
This is a text game.  If it ever runs on anything but Unix again it's
almost certain to be on something like WSL that supplies a
POSIX-conformant text console.
2017-05-18 17:18:16 -04:00
Eric S. Raymond
bd0487acc5 Remove a remnant of the old non-licensing. 2017-05-18 16:54:06 -04:00
Eric S. Raymond
b38c11abef Use prototypes and bools. 2017-05-18 09:06:32 -04:00
Eric S. Raymond
c9e9b64575 Partially ANSIfy C, fix compiler warnings. 2017-05-18 08:55:38 -04:00
Eric S. Raymond
3d8a9827dd Typo fix. 2017-05-18 07:31:10 -04:00
Eric S. Raymond
c1635d7378 Add control file for shipper. 2017-05-18 07:30:04 -04:00
Eric S. Raymond
8e73ebf31b Consistent use of 'advent' to avoid collision with BSD Games.
Manual page added.
2017-05-18 07:18:53 -04:00
Eric S. Raymond
68712ce666 Add README. More history. 2017-05-15 04:00:49 -04:00
Eric S. Raymond
13d4f5bda0 Relicense to 2-clause BSD. Befin the history document. 2017-05-15 01:57:17 -04:00
Eric S. Raymond
50ab7b9d47 Minimal forward-port to modern C - just enough to get it to compile. 2017-02-16 13:14:57 -05:00