X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=sst.py;h=b2067e965cfa4863bf58e7a9f9a03cf647363a6b;hp=242022296e03d3d7835693ebd498a0eebb75845f;hb=a55789a881356bff9acdfe48b5acae8c3b136ddf;hpb=0174113d9fcee47845fb36efb171d9be864e6641 diff --git a/sst.py b/sst.py index 2420222..b2067e9 100755 --- a/sst.py +++ b/sst.py @@ -44,7 +44,7 @@ def _(st): class randomizer: # LCG PRNG parameters tested against - # Knuth vol. 2. by the authors of ADVENT + # Knuth vol. 2. by the authors of ADVENT LCG_A = 1093 LCG_C = 221587 LCG_M = 1048576 @@ -53,7 +53,7 @@ class randomizer: def random(): old_x = game.lcg_x game.lcg_x = (randomizer.LCG_A * game.lcg_x + randomizer.LCG_C) % randomizer.LCG_M - return old_x / randomizer.LCG_M; + return old_x / randomizer.LCG_M @staticmethod def withprob(p): @@ -196,8 +196,8 @@ class Coord: return self.roundtogrid() % QUADSIZE def scatter(self): s = Coord() - s.i = self.i + rnd.range(-1, 2) - s.j = self.j + rnd.range(-1, 2) + s.i = self.i + rnd.integer(-1, 2) + s.j = self.j + rnd.integer(-1, 2) return s def __str__(self): if self.i is None or self.j is None: @@ -5356,6 +5356,9 @@ def sectscan(goodScan, i, j): 'C':LIGHTRED, 'R':LIGHTRED, 'T':LIGHTRED, + '@':LIGHTGREEN, + 'P':LIGHTGREEN, + '?':MAGENTA, }.get(game.quad[i][j], DEFAULT)) proutn("%c " % game.quad[i][j]) textcolor(DEFAULT)