projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Run pylint on check.
[super-star-trek.git]
/
sst.py
diff --git
a/sst.py
b/sst.py
index 242022296e03d3d7835693ebd498a0eebb75845f..8edb61b3022bc6dd1132cbba0d724d6718ebad2e 100755
(executable)
--- a/
sst.py
+++ b/
sst.py
@@
-17,6
+17,7
@@
from __future__ import print_function, division
import os, sys, math, curses, time, pickle, copy, gettext, getpass
import getopt, socket, locale
import os, sys, math, curses, time, pickle, copy, gettext, getpass
import getopt, socket, locale
+import codecs
# This import only works on Unixes. The intention is to enable
# Ctrl-P, Ctrl-N, and friends in Cmd.
# This import only works on Unixes. The intention is to enable
# Ctrl-P, Ctrl-N, and friends in Cmd.
@@
-44,7
+45,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
+54,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
+197,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:
@@
-2858,7
+2859,7
@@
def supernova(w):
for nq.i in range(GALSIZE):
for nq.j in range(GALSIZE):
nstars += game.state.galaxy[nq.i][nq.j].stars
for nq.i in range(GALSIZE):
for nq.j in range(GALSIZE):
nstars += game.state.galaxy[nq.i][nq.j].stars
- if stars == 0:
+ if
n
stars == 0:
return # nothing to supernova exists
num = rnd.integer(nstars) + 1
for nq.i in range(GALSIZE):
return # nothing to supernova exists
num = rnd.integer(nstars) + 1
for nq.i in range(GALSIZE):
@@
-3522,7
+3523,7
@@
def prouts(proutsline):
def cgetline():
"Get a line of input."
if game.options & OPTION_CURSES:
def cgetline():
"Get a line of input."
if game.options & OPTION_CURSES:
- linein = c
urwnd.getstr(
) + "\n"
+ linein = c
odecs.decode(curwnd.getstr()
) + "\n"
curwnd.refresh()
else:
if replayfp and not replayfp.closed:
curwnd.refresh()
else:
if replayfp and not replayfp.closed:
@@
-5356,6
+5357,8
@@
def sectscan(goodScan, i, j):
'C':LIGHTRED,
'R':LIGHTRED,
'T':LIGHTRED,
'C':LIGHTRED,
'R':LIGHTRED,
'T':LIGHTRED,
+ '@':LIGHTGREEN,
+ 'P':LIGHTGREEN,
}.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)