on how to modify (and how not to modify!) this code.
"""
from __future__ import print_function, division
+# Runs under Python 2 an Python 3. Preserve this property!
+# SPDX-License-Identifier: BSD-2-clause
import os, sys, math, curses, time, pickle, copy, gettext, getpass
import getopt, socket, locale
s = Coord()
if self.i == 0:
s.i = 0
- elif s.i < 0:
+ elif self.i < 0:
s.i = -1
else:
s.i = 1
game.tholian.move(None)
prout("***Internal error: Tholian in a bad spot.")
return
+ print("Tholian moving from %s to %s" % (game.tholian.location, tid))
# do nothing if we are blocked
if game.quad[tid.i][tid.j] not in ('.', '#'):
return
proutn(_("Number of torpedoes to fire- "))
continue # Go back around to get a number
else: # key == "IHREAL"
- n = scanner.int()
+ try:
+ n = scanner.int()
+ except TypeError:
+ huh()
+ return
if n <= 0: # abort command
scanner.chew()
return
prout(_("Manual-fire-must-be-used"))
skip(1)
elif automode == "MANUAL":
+ print("****HERE WE ARE*** %d" % len(game.enemies))
rpow = 0.0
for k in range(len(game.enemies)):
aim = game.enemies[k].location
scanner.chew()
key = "IHEOL"
hits[k] = 0 # prevent overflow -- thanks to Alexei Voitenko
- k += 1
continue
if key == "IHEOL":
scanner.chew()
# abort out
scanner.chew()
return
- hits[k] = scanner.real
+ print("k is %d" % k)
+ hits.append(scanner.real)
rpow += scanner.real
# If total requested is too much, inform and start over
if rpow > avail:
scanner.chew()
return
key = scanner.nexttok() # scan for next value
- k += 1
if rpow == 0.0:
# zero energy -- abort
scanner.chew()