X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=sst.py;h=b1ab2f3487b232413ff89f1c7dfd2653090881c6;hp=0ef0f092018d5931580923ece5694c1580ac6915;hb=64f27583b946baa7fc75dc6b05947c28ab0741cb;hpb=d07b7b4c26776011f703a7a4ed5ae792bfc46bea diff --git a/sst.py b/sst.py index 0ef0f09..b1ab2f3 100755 --- a/sst.py +++ b/sst.py @@ -745,7 +745,7 @@ def supercommander(): for (i, base) in enumerate(game.state.baseq): basetbl.append((i, (base - sc).distance())) if game.state.baseq > 1: - basetbl.sort(lambda x, y: cmp(x[1], y[1])) + basetbl.sort(key=lambda x: x[1]) # look for nearest base without a commander, no Enterprise, and # without too many Klingons, and not already under attack. ifindit = iwhichb = 0 @@ -3114,12 +3114,12 @@ rows = linecount = 0 # for paging stdscr = None replayfp = None fullscreen_window = None -srscan_window = None -report_window = None -status_window = None -lrscan_window = None -message_window = None -prompt_window = None +srscan_window = None # Short range scan +report_window = None # Report legends for status window +status_window = None # The status window itself +lrscan_window = None # Long range scan +message_window = None # Main window for scrolling text +prompt_window = None # Prompt window at bottom of display curwnd = None def iostart(): @@ -5734,7 +5734,7 @@ def newkling(): def sortenemies(): "Sort enemies by distance so 'nearest' is meaningful." - game.enemies.sort(lambda x, y: cmp(x.kdist, y.kdist)) + game.enemies.sort(key=lambda x: x.kdist) def newqad(): "Set up a new state of quadrant, for when we enter or re-enter it." @@ -5875,38 +5875,38 @@ commands = [ ("TORPEDO", 0), ("PHOTONS", 0), ("MOVE", 0), - ("SHIELDS", 0), + ("SHIELDS", 0), ("DOCK", 0), - ("DAMAGES", 0), + ("DAMAGES", 0), ("CHART", 0), ("IMPULSE", 0), ("REST", 0), ("WARP", 0), ("SCORE", 0), ("SENSORS", OPTION_PLANETS), - ("ORBIT", OPTION_PLANETS), + ("ORBIT", OPTION_PLANETS), ("TRANSPORT", OPTION_PLANETS), - ("MINE", OPTION_PLANETS), - ("CRYSTALS", OPTION_PLANETS), + ("MINE", OPTION_PLANETS), + ("CRYSTALS", OPTION_PLANETS), ("SHUTTLE", OPTION_PLANETS), ("PLANETS", OPTION_PLANETS), ("REPORT", 0), ("COMPUTER", 0), ("COMMANDS", 0), - ("EMEXIT", 0), - ("PROBE", OPTION_PROBE), - ("SAVE", 0), - ("FREEZE", 0), # Synonym for SAVE + ("EMEXIT", 0), + ("PROBE", OPTION_PROBE), + ("SAVE", 0), + ("FREEZE", 0), # Synonym for SAVE ("ABANDON", 0), ("DESTRUCT", 0), ("DEATHRAY", 0), ("DEBUG", 0), - ("MAYDAY", 0), - ("SOS", 0), # Synonym for MAYDAY - ("CALL", 0), # Synonym for MAYDAY - ("QUIT", 0), - ("HELP", 0), - ("", 0), + ("MAYDAY", 0), + ("SOS", 0), # Synonym for MAYDAY + ("CALL", 0), # Synonym for MAYDAY + ("QUIT", 0), + ("HELP", 0), + ("", 0), ] def listCommands():