projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Be a bit more colorful.
[super-star-trek.git]
/
sst.py
diff --git
a/sst.py
b/sst.py
index 242022296e03d3d7835693ebd498a0eebb75845f..b2067e965cfa4863bf58e7a9f9a03cf647363a6b 100755
(executable)
--- a/
sst.py
+++ b/
sst.py
@@
-44,7
+44,7
@@
def _(st):
class randomizer:
# LCG PRNG parameters tested against
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
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
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):
@staticmethod
def withprob(p):
@@
-196,8
+196,8
@@
class Coord:
return self.roundtogrid() % QUADSIZE
def scatter(self):
s = 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:
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,
'C':LIGHTRED,
'R':LIGHTRED,
'T':LIGHTRED,
+ '@':LIGHTGREEN,
+ 'P':LIGHTGREEN,
+ '?':MAGENTA,
}.get(game.quad[i][j], DEFAULT))
proutn("%c " % game.quad[i][j])
textcolor(DEFAULT)
}.get(game.quad[i][j], DEFAULT))
proutn("%c " % game.quad[i][j])
textcolor(DEFAULT)