Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions sst.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""
import os, sys, math, curses, time, readline, pickle, random, copy, gettext, getpass

version = "2.1.1"
version = "2.1"

docpath = (".", "../doc", "/usr/share/doc/sst")

Expand Down Expand Up @@ -108,14 +108,17 @@ def sgn(self):
else:
s.j = self.j / abs(self.j)
return s

def quadrant(self):
#print "Location %s -> %s" % (self, (self / QUADSIZE).roundtogrid())
<<<<<<< HEAD
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну что это?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это исторический комментарий, я обнаружил что в первой версии своей правки потерял его, теперь вернул. Однако конструкция "(self / QUADSIZE).roundtogrid()" не рабочая возможно из-за эволюции среды Пайтон, у меня версия Python 3.6.8

#return self.roundtogrid() / QUADSIZE
iq = self.roundtogrid()
iq.i = int(iq.i/QUADSIZE)
iq.j = int(iq.j/QUADSIZE)
return iq
=======
return self.roundtogrid() / QUADSIZE
>>>>>>> parent of 3eef073... adapted to centos
def sector(self):
return self.roundtogrid() % QUADSIZE
def scatter(self):
Expand Down Expand Up @@ -3282,7 +3285,7 @@ def cgetline():
elif line[0] != "#":
break
else:
line = str(input()) + "\n"
line = eval(input()) + "\n"
if logfp:
logfp.write(line)
return line
Expand Down Expand Up @@ -3825,8 +3828,7 @@ def __init__(self, bearing, distance, origin=None):
self.origin = cartesian(game.quadrant, origin)
self.increment = Coord(-math.sin(self.angle), math.cos(self.angle))
bigger = max(abs(self.increment.i), abs(self.increment.j))
#self.increment /= bigger
self.increment = Coord(self.increment.i/bigger, self.increment.j/bigger)
self.increment /= bigger
self.moves = int(round(10*self.distance*bigger))
self.reset()
self.final = (self.location + self.moves*self.increment).roundtogrid()
Expand Down