super-star-trek.git
14 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.

14 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.

14 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.

14 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.

14 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

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.)

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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...

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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

14 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.

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

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

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

14 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)

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 years agoGet rid of obnoxious visible "have we paused?" state.
Eric S. Raymond [Thu, 28 Sep 2006 09:19:16 +0000 (09:19 +0000)]
Get rid of obnoxious visible "have we paused?" state.

This change shouldn't make any behavioral difference, but it
simplifies the call sequence and code of a couple of functions.

14 years agoChange some ugly and misleading names.
Eric S. Raymond [Thu, 28 Sep 2006 08:20:52 +0000 (08:20 +0000)]
Change some ugly and misleading names.

14 years agoClean up nasty FORTRAN-style if statements.
Eric S. Raymond [Thu, 28 Sep 2006 08:01:45 +0000 (08:01 +0000)]
Clean up nasty FORTRAN-style if statements.

E.g., with the body on the same line as the guard.  They're bad style
and make the code hard to read, and I got fed up,

14 years agoParallel cleanups in the C and scratch Python code.
Eric S. Raymond [Wed, 27 Sep 2006 21:46:35 +0000 (21:46 +0000)]
Parallel cleanups in the C and scratch Python code.

14 years agobugfix in fry() and translation
Stas Sergeev [Wed, 27 Sep 2006 16:27:49 +0000 (16:27 +0000)]
bugfix in fry() and translation

14 years agobetter fix for is_valid()
Stas Sergeev [Tue, 26 Sep 2006 17:46:57 +0000 (17:46 +0000)]
better fix for is_valid()

14 years agoYet another rollup patch.
Stas Sergeev [Tue, 26 Sep 2006 17:27:51 +0000 (17:27 +0000)]
Yet another rollup patch.

- proper localization of dreprt()
- fixed preport() which didn't work at all
- fixed a nasty bug in photon() which caused a misfired torpedo to proceed
- fixed a very nasty bug in is_valid()
- many translation fixes

14 years agofew assorted adjustments and a fix for #8883
Stas Sergeev [Mon, 25 Sep 2006 16:53:11 +0000 (16:53 +0000)]
few assorted adjustments and a fix for #8883

14 years agofix makehelp.py invocation
Stas Sergeev [Sun, 24 Sep 2006 14:20:15 +0000 (14:20 +0000)]
fix makehelp.py invocation

14 years agoTrial Python now incorporates ai.c
Eric S. Raymond [Sun, 24 Sep 2006 11:04:28 +0000 (11:04 +0000)]
Trial Python now incorporates ai.c

14 years agoAnother rollup patch.
Stas Sergeev [Fri, 22 Sep 2006 17:09:23 +0000 (17:09 +0000)]
Another rollup patch.

- use ARRAY_SIZE
- cleaned up srscan()
- introduced a separate ncurses window for status
- removed completed TODO entries
- fixed SIGSEGV in tty mode when env LINES is undefined (always!)
- made "Please enter password" message visible
- made the above message to appear for OPTION_PLAIN instead of !OPTION_CURSES
- killed enqueue()
- localized status() (added helper prstat() )
- enabled gcc to check the format arguments, which uncovered a lot of
  the real bugs!
- fixed the bugs uncovered by the gcc format checking (the last one in
  ai.c is left for Eric :)
- fixed problem with skip(): it relied on "linecount", but "linecount"
  doesn't increment when you enter the multiline answers, like, for example,
  the torpedo courses. The fix works only in curses mode though - no idea
  how to fix this for tty.
- localized prouts(), however, not very cleanly. Any help is appreciated,
  see the added comments.

14 years agoBeginning of experimental Python translation.
Eric S. Raymond [Fri, 22 Sep 2006 16:18:30 +0000 (16:18 +0000)]
Beginning of experimental Python translation.

The initial file is definitions corresponding to sst.h.

14 years agoAdded appending on development timeline.
Eric S. Raymond [Fri, 22 Sep 2006 14:11:43 +0000 (14:11 +0000)]
Added appending on development timeline.

14 years agoAbstract away the operations involving a sentinel value for coordinates.
Eric S. Raymond [Fri, 22 Sep 2006 11:38:54 +0000 (11:38 +0000)]
Abstract away the operations involving a sentinel value for coordinates.

Besides making the code more readable, the sentinel may change someday
if we go zero-origin everywhere.

14 years agoMake the "crystals' member into an enumeration.
Eric S. Raymond [Thu, 21 Sep 2006 18:16:38 +0000 (18:16 +0000)]
Make the "crystals' member into an enumeration.

Also, add explanatory comments to the attack code.  Remove some redundant
logic to push you out of dock on an attack.

14 years agoMore applications of same().
Eric S. Raymond [Thu, 21 Sep 2006 10:47:26 +0000 (10:47 +0000)]
More applications of same().

14 years agoGet rid of obnoxious iattak global.
Eric S. Raymond [Wed, 20 Sep 2006 21:18:05 +0000 (21:18 +0000)]
Get rid of obnoxious iattak global.

This was a kluge to prevent recursion through an infinit regress of
moves leading to exit attacks forcing moves, etc.

14 years agoOn Stas Sergeev's suggestion, change where the logfile is written.
Eric S. Raymond [Wed, 20 Sep 2006 20:50:53 +0000 (20:50 +0000)]
On Stas Sergeev's suggestion, change where the logfile is written.

14 years agoallow gcc to still do the bounds checking
Stas Sergeev [Wed, 20 Sep 2006 19:00:34 +0000 (19:00 +0000)]
allow gcc to still do the bounds checking

14 years agoClean up some boolean arguments.
Eric S. Raymond [Wed, 20 Sep 2006 18:10:28 +0000 (18:10 +0000)]
Clean up some boolean arguments.

14 years agoand this gettextized in while I was resolving the rejects...
Stas Sergeev [Wed, 20 Sep 2006 17:02:59 +0000 (17:02 +0000)]
and this gettextized in while I was resolving the rejects...

14 years agothis gettextized by mistake
Stas Sergeev [Wed, 20 Sep 2006 16:51:13 +0000 (16:51 +0000)]
this gettextized by mistake

14 years agoRollup patch.
Stas Sergeev [Wed, 20 Sep 2006 16:42:35 +0000 (16:42 +0000)]
Rollup patch.

- completed the first pass on the gettextization and translation
- better (IMHO) fix for the initialization of the gettextized string arrays
- do not clearscreen on exit to leave the "Galaxy Bird" message visible
- implemented scroll-pausing for "help"
- fixed enqueue() which didn't always work
- added IHW to cramen()

14 years agoIncorporate BSD-Trek visual-scan code, just in case.
Eric S. Raymond [Wed, 20 Sep 2006 16:29:48 +0000 (16:29 +0000)]
Incorporate BSD-Trek visual-scan code, just in case.

14 years agoChase more booleans and enums.
Eric S. Raymond [Wed, 20 Sep 2006 15:47:19 +0000 (15:47 +0000)]
Chase more booleans and enums.

14 years agoA bit of documentation swiped and edited from the BSD code.
Eric S. Raymond [Wed, 20 Sep 2006 09:45:17 +0000 (09:45 +0000)]
A bit of documentation swiped and edited from the BSD code.

14 years agoBSD-Trek-like critical hits with weighting.
Eric S. Raymond [Wed, 20 Sep 2006 08:55:41 +0000 (08:55 +0000)]
BSD-Trek-like critical hits with weighting.

14 years agoReplace more #defines with enums.
Eric S. Raymond [Wed, 20 Sep 2006 06:25:57 +0000 (06:25 +0000)]
Replace more #defines with enums.

14 years agoChange the condition field from an uint with #defines to an enum.
Eric S. Raymond [Wed, 20 Sep 2006 05:31:21 +0000 (05:31 +0000)]
Change the condition field from an uint with #defines to an enum.

14 years agoMore boolean-chasing and coord applications.
Eric S. Raymond [Wed, 20 Sep 2006 05:18:07 +0000 (05:18 +0000)]
More boolean-chasing and coord applications.

14 years agoStill more application of coord type.
Eric S. Raymond [Wed, 20 Sep 2006 04:35:23 +0000 (04:35 +0000)]
Still more application of coord type.

14 years agoMore uses of distance() macro. Eliminate some magic numbers.
Eric S. Raymond [Wed, 20 Sep 2006 03:57:04 +0000 (03:57 +0000)]
More uses of distance() macro. Eliminate some magic numbers.

14 years agoMore boolean cleanups. More consistent use of coord type
Eric S. Raymond [Wed, 20 Sep 2006 03:26:16 +0000 (03:26 +0000)]
More boolean cleanups.  More consistent use of coord type

Anong other things, this allows us to write a distance() macro and get
rid of a lot of gnarly expressions.

14 years agoClean up more booleans.
Eric S. Raymond [Tue, 19 Sep 2006 23:56:55 +0000 (23:56 +0000)]
Clean up more booleans.

14 years agoClean up the rather nasty logoc of snova(), and fix a minor navigation bug.
Eric S. Raymond [Tue, 19 Sep 2006 23:09:39 +0000 (23:09 +0000)]
Clean up the rather nasty logoc of snova(), and fix a minor navigation bug.

...(inability to select manual mode) introduced by a recent commit.

14 years agoMore boolean cleanups and explanator comments.
Eric S. Raymond [Tue, 19 Sep 2006 22:03:07 +0000 (22:03 +0000)]
More boolean cleanups and explanator comments.

14 years agoMore type cleanup and explanatory comments.
Eric S. Raymond [Tue, 19 Sep 2006 21:30:15 +0000 (21:30 +0000)]
More type cleanup and explanatory comments.

14 years agoMore type cleanup.
Eric S. Raymond [Tue, 19 Sep 2006 21:00:29 +0000 (21:00 +0000)]
More type cleanup.

14 years agoMore boolean cleanups.
Eric S. Raymond [Tue, 19 Sep 2006 19:35:24 +0000 (19:35 +0000)]
More boolean cleanups.

14 years agoAvoid a nasty bug in planet-name display, and fix another boolean.
Eric S. Raymond [Tue, 19 Sep 2006 19:20:43 +0000 (19:20 +0000)]
Avoid a nasty bug in planet-name display, and fix another boolean.

14 years agoMore BSD features.
Eric S. Raymond [Tue, 19 Sep 2006 19:04:35 +0000 (19:04 +0000)]
More BSD features.

You can now lose if your entire crew dies in battle.  When abandoning
ship in a game with inhabited worlds enabled, they must have one in
the quadrant to beam down to; otherwise they die in space and this
counts heavily against your score (BSD Trek had score adjustment as a
to-do).  Docking at a starbase replenishes your crew.

14 years agomore gettextizing and translating
Stas Sergeev [Tue, 19 Sep 2006 18:44:07 +0000 (18:44 +0000)]
more gettextizing and translating

14 years agoAbstract out damage checks.
Eric S. Raymond [Tue, 19 Sep 2006 18:13:35 +0000 (18:13 +0000)]
Abstract out damage checks.

Implement BSD-Trek check in abandon-ship routine that transporter is
operational and an inhabited planet is nearby before crew can beam
down, otherwise they die in space.  (But this isn't counted against
your score yet.)

14 years agoKlingon ship births are working.
Eric S. Raymond [Tue, 19 Sep 2006 10:14:04 +0000 (10:14 +0000)]
Klingon ship births are working.

14 years agoMore booleans cleanup.
Eric S. Raymond [Tue, 19 Sep 2006 09:19:41 +0000 (09:19 +0000)]
More booleans cleanup.

14 years agoFDISTR/FENSLV/FREPRO sequence looks like it's working.
Eric S. Raymond [Tue, 19 Sep 2006 08:56:52 +0000 (08:56 +0000)]
FDISTR/FENSLV/FREPRO sequence looks like it's working.

14 years agoFix two minor bugs, one in the shove code and one in debugme().
Eric S. Raymond [Tue, 19 Sep 2006 08:28:19 +0000 (08:28 +0000)]
Fix two minor bugs, one in the shove code and one in debugme().

14 years agoImprovements to the testing machinery, including the replay option.
Eric S. Raymond [Tue, 19 Sep 2006 08:05:42 +0000 (08:05 +0000)]
Improvements to the testing machinery, including the replay option.

14 years agoImprove the world list.
Eric S. Raymond [Tue, 19 Sep 2006 08:01:27 +0000 (08:01 +0000)]
Improve the world list.