From b571781c68664513124e55e9a42790cce931f6f3 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 9 Oct 2006 21:53:56 +0000 Subject: [PATCH] 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). --- src/sst.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sst.py b/src/sst.py index 56ce6fa..df17ca7 100644 --- a/src/sst.py +++ b/src/sst.py @@ -242,7 +242,7 @@ class coord: def __eq__(self, other): return other != None and self.x == other.y and self.x == other.y def __add__(self, other): - return coord(self.x+self.x, self.y+self.y) + return coord(self.x+other.x, self.y+other.y) def __sub__(self, other): return coord(self.x-other.x, self.y-other.y) def __mul__(self, other): @@ -615,10 +615,9 @@ def randreal(*args): def welcoming(iq): "Would this quadrant welcome another Klingon?" return VALID_QUADRANT(iq.x,iq.y) and \ - not game.state.galaxy[iq.x][iq.y].supernova or \ + not game.state.galaxy[iq.x][iq.y].supernova and \ game.state.galaxy[iq.x][iq.y].klingons < MAXKLQUAD - def tryexit(enemy, look, irun): "A bad guy attempts to bug out." iq = coord() @@ -3987,12 +3986,12 @@ def getcourse(isprobe, akey): if key != IHREAL: huh() return False - delta.x = scanner.real + delta.y = scanner.real key = scanner.next() if key != IHREAL: huh() return False - delta.y = scanner.real + delta.x = scanner.real # Check for zero movement if delta.x == 0 and delta.y == 0: scanner.chew() -- 2.31.1