Commit graph

385 commits

Author SHA1 Message Date
Eric S. Raymond
5c4fdc35eb Flush log on interrupt, just for convenience. 2017-05-26 07:22:24 -04:00
Eric S. Raymond
7763e1aa22 Repeatable seeding is working. 2017-05-25 18:52:39 -04:00
Eric S. Raymond
79ef3e38c2 Implement fallback handler that looks at the raw command buffer.
With database cinpilation not broken this time...
2017-05-25 18:21:38 -04:00
Eric S. Raymond
6ba9a7de7f 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-05-24 23:36:25 -04:00
Eric S. Raymond
3a2c0ca199 Reapply "Clean up logic for exiting input loop and scoring." 2017-05-24 22:51:36 -04:00
Jason S. Ninneman
ba1369310d Remove disused label. 2017-05-24 15:43:34 -07:00
Eric S. Raymond
31837249f8 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-05-24 18:24:09 -04:00
Eric S. Raymond
c703bd78d9 Clean up logic for exiting input loop and scoring. 2017-05-24 11:16:59 -04:00
Eric S. Raymond
cf219e920b Seed command fully implemented but apparently buggy.
Dwarf appearance is not yet reproducible.
2017-05-24 09:06:41 -04:00
Eric S. Raymond
65c081a0ac Implement stub handler for SEED command. Not hooked up to PRNG yet. 2017-05-24 08:30:06 -04:00
Jason S. Ninneman
8a8770375e Add seedable PRNG using an adaptation the original LCG algorithm. 2017-05-23 23:37:56 -07:00
Eric S. Raymond
484ca4e9fd 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-05-24 00:17:19 -04:00
Eric S. Raymond
f9eb6383f1 Revert a variable name previously changed to be out of the way.
Also, make output from replays easier to interpret by adding prompts.
2017-05-23 22:29:24 -04:00
Eric S. Raymond
f72141fbe3 More structurization. 2017-05-23 20:59:21 -04:00
Eric S. Raymond
f68f3a1205 More globals to the game structure. 2017-05-23 20:34:53 -04:00
Eric S. Raymond
c3add5c206 More global-to-structure moves. 2017-05-23 20:22:35 -04:00
Eric S. Raymond
50ed247042 More comment cleanup. 2017-05-23 19:49:49 -04:00
Eric S. Raymond
bbe68abd30 Fixed case in a comment. 2017-05-23 19:45:18 -04:00
Eric S. Raymond
fa1f859162 Move more globals into the state structure. 2017-05-23 19:40:34 -04:00
Eric S. Raymond
42189d79d7 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-05-23 18:47:04 -04:00
Eric S. Raymond
dc9d9e467b 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-05-23 15:57:38 -04:00
Eric S. Raymond
c6867b374a Begin factoring out the command interpreter. 2017-05-23 14:48:41 -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
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
01b2c05cbb More magic-number elimination. 2017-05-22 20:51:55 -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
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
50ab7b9d47 Minimal forward-port to modern C - just enough to get it to compile. 2017-02-16 13:14:57 -05:00
Eric S. Raymond
24d7aeaf8a Don Wood's 430-point Adventure 2.5 from 1995, from rec.games.int-fiction. 2017-02-16 11:59:50 -05:00