return Coord(self.i*other, self.j*other)
def __rmul__(self, other):
return Coord(self.i*other, self.j*other)
return Coord(self.i*other, self.j*other)
def __rmul__(self, other):
return Coord(self.i*other, self.j*other)
return Coord(self.i//other, self.j//other)
def __mod__(self, other):
return Coord(self.i % other, self.j % other)
return Coord(self.i//other, self.j//other)
def __mod__(self, other):
return Coord(self.i % other, self.j % other)
if (game.options & OPTION_ALPHAMERIC):
return letterize(self.i + 1) + str(self.j + 1)
return "%s - %s" % (self.i+1, self.j+1)
if (game.options & OPTION_ALPHAMERIC):
return letterize(self.i + 1) + str(self.j + 1)
return "%s - %s" % (self.i+1, self.j+1)
- return "<%s,%s,%s>" % (self.klingons, self.starbase, self.stars)
+ return "<%s,%s,%s>" % (self.klingons, self.starbase, self.stars) # pragma: no cover
def fill2d(size, fillfun):
"Fill an empty list in 2D."
def fill2d(size, fillfun):
"Fill an empty list in 2D."
# Abstract out the event handling -- underlying data structures will change
# when we implement stateful events
# Abstract out the event handling -- underlying data structures will change
# when we implement stateful events
- return "<%s,%s.%f>" % (self.type, self.location, self.power) # For debugging
+ return "<%s,%s.%f>" % (self.type, self.location, self.power) # pragma: no cover
# which was silly. Instead, pick up to half the devices at
# random according to our weighting table,
ncrits = rnd.integer(NDEVICES//2)
# which was silly. Instead, pick up to half the devices at
# random according to our weighting table,
ncrits = rnd.integer(NDEVICES//2)
prout("=== EVENTS from %.2f to %.2f:" % (game.state.date, fintim))
for i in range(1, NEVENTS):
if i == FSNOVA: proutn("=== Supernova ")
prout("=== EVENTS from %.2f to %.2f:" % (game.state.date, fintim))
for i in range(1, NEVENTS):
if i == FSNOVA: proutn("=== Supernova ")
prout(_("The Galileo is instantly annihilated by the supernova."))
prout(_("You and your mining party are atomized."))
skip(1)
prout(_("The Galileo is instantly annihilated by the supernova."))
prout(_("You and your mining party are atomized."))
skip(1)
prout(_("LEGAL COMMANDS ARE:"))
emitted = 0
for (key, opt) in commands:
prout(_("LEGAL COMMANDS ARE:"))
emitted = 0
for (key, opt) in commands:
elif ch == '#': s = _("Tholian web")
elif ch == '?': s = _("Stranger")
elif ch == '@': s = _("Inhabited World")
elif ch == '#': s = _("Tholian web")
elif ch == '?': s = _("Stranger")
elif ch == '@': s = _("Inhabited World")
return s
def crmena(loud, enemy, loctype, w):
return s
def crmena(loud, enemy, loctype, w):
return "<sstcanner: token=%s, type=%s, queue=%s>" % (self.token, self.type, self.inqueue)
def ja():
return "<sstcanner: token=%s, type=%s, queue=%s>" % (self.token, self.type, self.inqueue)
def ja():
sys.stderr.write("sst: replay file %s is ill-formed\n"% val)
raise SystemExit(1)
game.options |= OPTION_TTY
game.options &=~ OPTION_CURSES
sys.stderr.write("sst: replay file %s is ill-formed\n"% val)
raise SystemExit(1)
game.options |= OPTION_TTY
game.options &=~ OPTION_CURSES
sys.stderr.write("usage: sst [-t] [-x] [startcommand...].\n")
raise SystemExit(1)
# where to save the input in case of bugs
sys.stderr.write("usage: sst [-t] [-x] [startcommand...].\n")
raise SystemExit(1)
# where to save the input in case of bugs
tmpdir = os.environ['TMPDIR']
else:
tmpdir = "/tmp"
try:
logfp = open(os.path.join(tmpdir, "sst-input.log"), "w")
tmpdir = os.environ['TMPDIR']
else:
tmpdir = "/tmp"
try:
logfp = open(os.path.join(tmpdir, "sst-input.log"), "w")