super-star-trek.git
17 years agoDebug the logic for deep-space probes.
Eric S. Raymond [Tue, 10 Oct 2006 15:38:45 +0000 (15:38 +0000)]
Debug the logic for deep-space probes.

17 years agoBetter wrapup on replays.
Eric S. Raymond [Tue, 10 Oct 2006 10:03:10 +0000 (10:03 +0000)]
Better wrapup on replays.

17 years agoNow the Python version works, let's deep-six this.
Eric S. Raymond [Tue, 10 Oct 2006 09:41:28 +0000 (09:41 +0000)]
Now the Python version works, let's deep-six this.

...so nobody else is tempted to go through the pain...

17 years agoRemove some scaffolding, comments that were guidance for code now working.
Eric S. Raymond [Tue, 10 Oct 2006 09:38:53 +0000 (09:38 +0000)]
Remove some scaffolding, comments that were guidance for code now working.

17 years agoPut a timestamp an email in lofiles. Add the replay debugging script.
Eric S. Raymond [Tue, 10 Oct 2006 09:25:53 +0000 (09:25 +0000)]
Put a timestamp an email in lofiles.  Add the replay debugging script.

And a tiny tweak to io.c.

17 years agoFix range error in Tholian movement.
Eric S. Raymond [Tue, 10 Oct 2006 08:51:43 +0000 (08:51 +0000)]
Fix range error in Tholian movement.

17 years agoUnscramble some of the trig-formula mess.
Eric S. Raymond [Tue, 10 Oct 2006 08:38:33 +0000 (08:38 +0000)]
Unscramble some of the trig-formula mess.

17 years agoFix listCommands.
Eric S. Raymond [Tue, 10 Oct 2006 08:20:59 +0000 (08:20 +0000)]
Fix listCommands.

17 years agocurses interface seems to work!
Eric S. Raymond [Tue, 10 Oct 2006 07:57:49 +0000 (07:57 +0000)]
curses interface seems to work!

17 years agoAtexit was screwing up the Python curses bindings. Weird.
Eric S. Raymond [Tue, 10 Oct 2006 07:41:34 +0000 (07:41 +0000)]
Atexit was screwing up the Python curses bindings. Weird.

17 years agoDon't try to do color initialization in Python yet, direct C
Eric S. Raymond [Tue, 10 Oct 2006 07:22:57 +0000 (07:22 +0000)]
Don't try to do color initialization in Python yet, direct C
translation of that code doesn't work.

17 years agoTime to make curses work.
Eric S. Raymond [Tue, 10 Oct 2006 07:06:46 +0000 (07:06 +0000)]
Time to make curses work.

17 years agoSimplify tac movement, handle more torpedo input cases correctly.
Eric S. Raymond [Tue, 10 Oct 2006 06:21:55 +0000 (06:21 +0000)]
Simplify tac movement, handle more torpedo input cases correctly.

17 years agoGet rid of a duplicative variable.
Eric S. Raymond [Tue, 10 Oct 2006 02:18:09 +0000 (02:18 +0000)]
Get rid of a duplicative variable.

17 years agoMake some constants into strings for better debugging messages.
Eric S. Raymond [Tue, 10 Oct 2006 02:09:10 +0000 (02:09 +0000)]
Make some constants into strings for better debugging messages.

17 years agoFix translation error that prevented commanders from being hit by torps.
Eric S. Raymond [Tue, 10 Oct 2006 01:56:31 +0000 (01:56 +0000)]
Fix translation error that prevented commanders from being hit by torps.

17 years agoMore nomenclature fixes.
Eric S. Raymond [Tue, 10 Oct 2006 01:14:36 +0000 (01:14 +0000)]
More nomenclature fixes.

17 years agoTwo sources of vast confusion in reading the C code are these:
Eric S. Raymond [Mon, 9 Oct 2006 23:14:11 +0000 (23:14 +0000)]
Two sources of vast confusion in reading the C code are these:

(1) the code uses x and y as though they're Cartesian coordinate
variables, but (inconsistently) swaps them around so that "x"
variables usually refer to the y direction in the output charts.

(2) Coordinates in the y direction (whether they are x variables or
not) increase *downwards* (charts are printed row zero first).

There is extremely ugly and confusing code in targetcheck() and
getcourse() where two opposite sets of conventions bump up against
each other.

As a first step, towards untangling this mess, we'll change the
nomenclature so that coordinate names refer to 'i' and 'j'
directions, as in matrix indices (i vertical, increasing downwards,
and j horizontal, increasing rightwards).  This patch does that for
the coord class members, also fixing two small bugs that turned
up during testing.

More steps will be necessary...

17 years agoFix another basic error.
Eric S. Raymond [Mon, 9 Oct 2006 22:51:25 +0000 (22:51 +0000)]
Fix another basic error.

17 years agoFix a rather basic error in vector comparisons.
Eric S. Raymond [Mon, 9 Oct 2006 22:40:21 +0000 (22:40 +0000)]
Fix a rather basic error in vector comparisons.

17 years agoThis version of the Python does both navigation and torps correctly.
Eric S. Raymond [Mon, 9 Oct 2006 21:53:56 +0000 (21:53 +0000)]
This version of the Python does both navigation and torps correctly.

...but the use of trig and variables is unbelievably snarled (legacy from
the C and FORTRAN code).

17 years agoAha! Found the lurking bug in the Python torpedo code. Now to clean up.
Eric S. Raymond [Mon, 9 Oct 2006 20:59:19 +0000 (20:59 +0000)]
Aha!  Found the lurking bug in the Python torpedo code.  Now to clean up.

17 years agoGet rid of a special case in the old code.
Eric S. Raymond [Mon, 9 Oct 2006 18:53:42 +0000 (18:53 +0000)]
Get rid of a special case in the old code.

17 years agoDead-code removal.
Eric S. Raymond [Mon, 9 Oct 2006 18:33:55 +0000 (18:33 +0000)]
Dead-code removal.

17 years agoannounce doesnt ask for enter
Stas Sergeev [Mon, 9 Oct 2006 17:41:34 +0000 (17:41 +0000)]
announce doesnt ask for enter

17 years agoMore code slimming in the Python version.
Eric S. Raymond [Mon, 9 Oct 2006 13:31:30 +0000 (13:31 +0000)]
More code slimming in the Python version.

17 years agoPython logic for torpedo-salvo input seems to work now.
Eric S. Raymond [Mon, 9 Oct 2006 12:55:21 +0000 (12:55 +0000)]
Python logic for torpedo-salvo input seems to work now.

There's still a glitch in the course computation.

17 years agoAdd -s option to Python version. Fix more minor bugs.
Eric S. Raymond [Mon, 9 Oct 2006 00:51:34 +0000 (00:51 +0000)]
Add -s option to Python version.  Fix more minor bugs.

17 years agoSmall port fixes.
Eric S. Raymond [Mon, 9 Oct 2006 00:14:35 +0000 (00:14 +0000)]
Small port fixes.

17 years agoMore refactoring of the Python version.
Eric S. Raymond [Sun, 8 Oct 2006 22:28:32 +0000 (22:28 +0000)]
More refactoring of the Python version.

17 years agoUse Python list operations to get rid of a lot of FORTRANish for loops.
Eric S. Raymond [Sun, 8 Oct 2006 22:18:25 +0000 (22:18 +0000)]
Use Python list operations to get rid of a lot of FORTRANish for loops.

17 years agoFound the bad distance/direction calculation.
Eric S. Raymond [Sun, 8 Oct 2006 21:01:59 +0000 (21:01 +0000)]
Found the bad distance/direction calculation.

17 years agoVarious minor port fixes.
Eric S. Raymond [Sun, 8 Oct 2006 20:36:51 +0000 (20:36 +0000)]
Various minor port fixes.

17 years agoUse object methods for vector calculations.
Eric S. Raymond [Sun, 8 Oct 2006 09:00:09 +0000 (09:00 +0000)]
Use object methods for vector calculations.

17 years agoTorpedo logic still isn't right, but we're getting there.
Eric S. Raymond [Sun, 8 Oct 2006 07:59:35 +0000 (07:59 +0000)]
Torpedo logic still isn't right, but we're getting there.

17 years agoSimplify some corner cases in the scanner code.
Eric S. Raymond [Sun, 8 Oct 2006 06:35:38 +0000 (06:35 +0000)]
Simplify some corner cases in the scanner code.

17 years agoRefactored lexical analyzer into a scanner class.
Eric S. Raymond [Sun, 8 Oct 2006 06:19:28 +0000 (06:19 +0000)]
Refactored lexical analyzer into a scanner class.

This will make it easier to replace the parser, when we need to do that.

17 years agoOops -- fix a typo that broke the scanner.
Eric S. Raymond [Sun, 8 Oct 2006 05:49:11 +0000 (05:49 +0000)]
Oops -- fix a typo that broke the scanner.

17 years agoFix Tholian motion.
Eric S. Raymond [Sun, 8 Oct 2006 02:56:00 +0000 (02:56 +0000)]
Fix Tholian motion.

17 years agoClear the new quadeant properly, otherwise we end up with ghost features.
Eric S. Raymond [Sat, 7 Oct 2006 06:40:00 +0000 (06:40 +0000)]
Clear the new quadeant properly, otherwise we end up with ghost features.

17 years agoStub out the color support in the Python version.
Eric S. Raymond [Sat, 7 Oct 2006 04:47:29 +0000 (04:47 +0000)]
Stub out the color support in the Python version.

Direct translation of the C doesn't work.  Also fix an argument-type bug.

17 years agoPreparation for making curses interface work in Python.
Eric S. Raymond [Sat, 7 Oct 2006 04:33:02 +0000 (04:33 +0000)]
Preparation for making curses interface work in Python.

17 years agoReady to start making the curses interface work.
Eric S. Raymond [Fri, 6 Oct 2006 20:15:41 +0000 (20:15 +0000)]
Ready to start making the curses interface work.

17 years agoMore code slimming.
Eric S. Raymond [Fri, 6 Oct 2006 19:00:27 +0000 (19:00 +0000)]
More code slimming.

17 years agoRefactor code to refer to enemy objects.
Eric S. Raymond [Fri, 6 Oct 2006 18:48:32 +0000 (18:48 +0000)]
Refactor code to refer to enemy objects.

17 years agoGot through an entire game with this Python version.
Eric S. Raymond [Fri, 6 Oct 2006 18:14:08 +0000 (18:14 +0000)]
Got through an entire game with this Python version.

17 years agoGet rid of the nasty old bubble sort in the Python version.
Eric S. Raymond [Fri, 6 Oct 2006 15:21:33 +0000 (15:21 +0000)]
Get rid of the nasty old bubble sort in the Python version.

17 years agoCollect three parallel arrays into an 'enemy' structure.
Eric S. Raymond [Fri, 6 Oct 2006 15:08:13 +0000 (15:08 +0000)]
Collect three parallel arrays into an 'enemy' structure.

17 years agoFixed bug in Python version's reporting of critical hits.
Eric S. Raymond [Fri, 6 Oct 2006 14:07:40 +0000 (14:07 +0000)]
Fixed bug in Python version's reporting of critical hits.

17 years agoMore port fixes for the Python version.
Eric S. Raymond [Fri, 6 Oct 2006 13:47:54 +0000 (13:47 +0000)]
More port fixes for the Python version.

17 years agoBug fix, keyboard interrupt handling, automatic LRSCAN before CHART.
Eric S. Raymond [Fri, 6 Oct 2006 12:30:27 +0000 (12:30 +0000)]
Bug fix, keyboard interrupt handling, automatic LRSCAN before CHART.

17 years agoProperly stringify enum value of "sector". Move the command prompt
Eric S. Raymond [Fri, 6 Oct 2006 12:01:30 +0000 (12:01 +0000)]
Properly stringify enum value of "sector".  Move the command prompt
back to the right place.

17 years agoReplay facility now captures command-line options.
Eric S. Raymond [Fri, 6 Oct 2006 11:00:25 +0000 (11:00 +0000)]
Replay facility now captures command-line options.

17 years agoReplay works now, at least in plain-tty mode
Eric S. Raymond [Fri, 6 Oct 2006 10:54:05 +0000 (10:54 +0000)]
Replay works now, at least in plain-tty mode

17 years agoCorrect off-by-one bug in placement of Tholian.
Eric S. Raymond [Fri, 6 Oct 2006 10:21:23 +0000 (10:21 +0000)]
Correct off-by-one bug in placement of Tholian.

17 years agoArrange for logging of random-number-generator calls.
Eric S. Raymond [Fri, 6 Oct 2006 09:46:40 +0000 (09:46 +0000)]
Arrange for logging of random-number-generator calls.

17 years agoDrop out the BSD visual-scan code.
Eric S. Raymond [Fri, 6 Oct 2006 03:25:24 +0000 (03:25 +0000)]
Drop out the BSD visual-scan code.

17 years agoMinor bug fixes, preparatory to finding out why replay doesn't work.
Eric S. Raymond [Fri, 6 Oct 2006 02:16:43 +0000 (02:16 +0000)]
Minor bug fixes, preparatory to finding out why replay doesn't work.

17 years agoAvoid divide-by-zero error.
Eric S. Raymond [Fri, 6 Oct 2006 01:19:43 +0000 (01:19 +0000)]
Avoid divide-by-zero error.

17 years agoMany small port fixes in the Python.
Eric S. Raymond [Thu, 5 Oct 2006 22:41:05 +0000 (22:41 +0000)]
Many small port fixes in the Python.

Get rid of game.ithere, we just test whether there is a valid
coordinate object for the Tholian instead.  Also, use deepcopy to make
snapshots.

17 years agoOK, warp flight between quadrants works now.
Eric S. Raymond [Thu, 5 Oct 2006 12:42:37 +0000 (12:42 +0000)]
OK, warp flight between quadrants works now.

17 years agoVarious minor fixes to movement code.
Eric S. Raymond [Thu, 5 Oct 2006 12:32:27 +0000 (12:32 +0000)]
Various minor fixes to movement code.

...and avoidance of errors raised by indexing with a float.

17 years agoLocal navigation now works in Python.
Eric S. Raymond [Thu, 5 Oct 2006 11:35:24 +0000 (11:35 +0000)]
Local navigation now works in Python.

Flight to other quadrants doesn't yet.  (The bugs all appear to be
consequences of moving to zero indexing.)

17 years agoGet rid of some dead code.
Eric S. Raymond [Thu, 5 Oct 2006 10:16:15 +0000 (10:16 +0000)]
Get rid of some dead code.

17 years agoPlanet pointer mess cleaned up. planets now works.
Eric S. Raymond [Thu, 5 Oct 2006 09:53:06 +0000 (09:53 +0000)]
Planet pointer mess cleaned up.  planets now works.

17 years agostatus command is almost working. Must resolve the mess with planet pointers.
Eric S. Raymond [Thu, 5 Oct 2006 09:12:06 +0000 (09:12 +0000)]
status command is almost working.  Must resolve the mess with planet pointers.

17 years agolrscan, scescan, and chart are working in the Python version.
Eric S. Raymond [Thu, 5 Oct 2006 08:58:28 +0000 (08:58 +0000)]
lrscan, scescan, and chart are working in the Python version.

17 years agoEliminate iqhere global in order to get rid of spurious Python warning.
Eric S. Raymond [Thu, 5 Oct 2006 08:36:54 +0000 (08:36 +0000)]
Eliminate iqhere global in order to get rid of spurious Python warning.

Where we need this flag, we now deduce it from the location of the Thing.

17 years ago0-origin code gets through initialization OK.
Eric S. Raymond [Thu, 5 Oct 2006 06:56:51 +0000 (06:56 +0000)]
0-origin code gets through initialization OK.

17 years agoCheckpoint Python version before trying to move to zero-origin indexing.
Eric S. Raymond [Thu, 5 Oct 2006 05:47:19 +0000 (05:47 +0000)]
Checkpoint Python version before trying to move to zero-origin indexing.

17 years agoPython IO queue appears to work.
Eric S. Raymond [Thu, 5 Oct 2006 04:21:56 +0000 (04:21 +0000)]
Python IO queue appears to work.

17 years agoPython version did its first I/O.
Eric S. Raymond [Thu, 5 Oct 2006 03:38:44 +0000 (03:38 +0000)]
Python version did its first I/O.

17 years agoPython translation is syntactically correct. Now for the grotty
Eric S. Raymond [Thu, 5 Oct 2006 02:30:35 +0000 (02:30 +0000)]
Python translation is syntactically correct.  Now for the grotty
part...

17 years agosetup.py code added to Python translation.
Eric S. Raymond [Wed, 4 Oct 2006 22:35:53 +0000 (22:35 +0000)]
setup.py code added to Python translation.

17 years agoPython translation now incorporates reports.c.
Eric S. Raymond [Wed, 4 Oct 2006 19:24:39 +0000 (19:24 +0000)]
Python translation now incorporates reports.c.

17 years agoplanets.c code incorporated into Python translation.
Eric S. Raymond [Wed, 4 Oct 2006 16:37:14 +0000 (16:37 +0000)]
planets.c code incorporated into Python translation.

17 years agoCode from moving.c incorporated into Python translation.
Eric S. Raymond [Wed, 4 Oct 2006 16:19:35 +0000 (16:19 +0000)]
Code from moving.c incorporated into Python translation.

17 years agoIncor[porated io.c code into Python translation.
Eric S. Raymond [Wed, 4 Oct 2006 14:54:15 +0000 (14:54 +0000)]
Incor[porated io.c code into Python translation.

17 years agofinish.c code incorporated into Python translation.
Eric S. Raymond [Wed, 4 Oct 2006 02:22:51 +0000 (02:22 +0000)]
finish.c code incorporated into Python translation.

17 years agoCorrect minor bug in figure-of-merit scoring.
Eric S. Raymond [Wed, 4 Oct 2006 02:05:50 +0000 (02:05 +0000)]
Correct minor bug in figure-of-merit scoring.

Inhabited-planet kills weren't being figured in. Also make the code clearer.

17 years agoMore of Stas's notes about the time recomputation bug.
Eric S. Raymond [Wed, 4 Oct 2006 01:37:55 +0000 (01:37 +0000)]
More of Stas's notes about the time recomputation bug.

17 years agoIncorporated events.c into Python.
Eric S. Raymond [Tue, 3 Oct 2006 19:29:35 +0000 (19:29 +0000)]
Incorporated events.c into Python.

17 years agoSmall cleanups discovered during Python translation.
Eric S. Raymond [Tue, 3 Oct 2006 18:19:39 +0000 (18:19 +0000)]
Small cleanups discovered during Python translation.

17 years agoAnother rollup patch.
Stas Sergeev [Tue, 3 Oct 2006 17:19:58 +0000 (17:19 +0000)]
Another rollup patch.

- fixed manual moving
- quick hack to avoid division by zero when calculating game.state.remtime
- fixed some problems with sensors() on ncurses
- small translation fixes

17 years agobattle.c incorporated into Python translation.
Eric S. Raymond [Tue, 3 Oct 2006 00:19:52 +0000 (00:19 +0000)]
battle.c incorporated into Python translation.

17 years agoadjustments
Stas Sergeev [Mon, 2 Oct 2006 19:03:33 +0000 (19:03 +0000)]
adjustments

17 years agoEliminate uses of cramlc().
Eric S. Raymond [Mon, 2 Oct 2006 17:17:04 +0000 (17:17 +0000)]
Eliminate uses of cramlc().

17 years agooops, revert ocasional change
Stas Sergeev [Mon, 2 Oct 2006 17:16:19 +0000 (17:16 +0000)]
oops, revert ocasional change

17 years agoAnother rollup patch.
Stas Sergeev [Mon, 2 Oct 2006 17:13:02 +0000 (17:13 +0000)]
Another rollup patch.

- Enabled more gcc warnings
- Fixed -Wundef warnings
- Fixes to inhabited-worlds code, the attempt to enslave the
  uninhabited planet is no longer made.
- Replaced pause_game(true) with announce() and killed the pause_latch()
  trick as it leaded to the lost scroll-pauses
- Fixed calculation of destroyed planets
- Made scan() locale-safe
- Translation updates

Gameplay changes:
- Removed the Romulans-guarding-inhabited-worlds behaviour that probably
  came from bsd-trek. Frankly, I find it much more annoying than enjoying.
- Added the behaveour of transporter consuming the ship's energy - inspired
  by Star Control 2's landing habit. If someone finds this too harsh -
  feel free to remove, but I personally find that logical. (!OPTION_PLAIN)

17 years agoPython translation now includes ai.c.
Eric S. Raymond [Mon, 2 Oct 2006 14:47:33 +0000 (14:47 +0000)]
Python translation now includes ai.c.

17 years agoGet rid of some macros that block mechanical translation.
Eric S. Raymond [Sat, 30 Sep 2006 09:00:49 +0000 (09:00 +0000)]
Get rid of some macros that block mechanical translation.

17 years agoCreate blank objects in all arrays during Python game state initialization.
Eric S. Raymond [Fri, 29 Sep 2006 09:39:24 +0000 (09:39 +0000)]
Create blank objects in all arrays during Python game state initialization.

17 years agoReset all structures for stupid literal translation of the game.
Eric S. Raymond [Fri, 29 Sep 2006 09:21:09 +0000 (09:21 +0000)]
Reset all structures for stupid literal translation of the game.

17 years agoGet rid of DESTROY macro.
Eric S. Raymond [Fri, 29 Sep 2006 07:59:45 +0000 (07:59 +0000)]
Get rid of DESTROY macro.

17 years agoGet rid of the iterator macros I wrote.
Eric S. Raymond [Fri, 29 Sep 2006 07:41:43 +0000 (07:41 +0000)]
Get rid of the iterator macros I wrote.

They interfere with mechanical translation.

17 years agoHack boxed xcomments so they're easier for a mechanical translator to recognize.
Eric S. Raymond [Thu, 28 Sep 2006 21:21:33 +0000 (21:21 +0000)]
Hack boxed xcomments so they're easier for a mechanical translator to recognize.

17 years agoClean up ugly FORTRANISH names.
Eric S. Raymond [Thu, 28 Sep 2006 10:52:08 +0000 (10:52 +0000)]
Clean up ugly FORTRANISH names.

It's been years since C public names had a  6-character significance limit.

17 years agoMore cleanup towards automated Python translation.
Eric S. Raymond [Thu, 28 Sep 2006 10:18:52 +0000 (10:18 +0000)]
More cleanup towards automated Python translation.

17 years agoMore elimination of FORTAN-style if statements.
Eric S. Raymond [Thu, 28 Sep 2006 09:48:31 +0000 (09:48 +0000)]
More elimination of FORTAN-style if statements.

17 years agoReset the translation, we're going to redo it with ctopy.
Eric S. Raymond [Thu, 28 Sep 2006 09:34:55 +0000 (09:34 +0000)]
Reset the translation, we're going to redo it with ctopy.