home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
1847f691a79f7cef829a3a6bc1b4323397e38488
[plomrogue2-experiments]
/
new2
/
plomrogue
/
mapping.py
1
import collections
2
3
4
5
class YX(collections.namedtuple('YX', ('y', 'x'))):
6
7
def __add__(self, other):
8
return YX(self.y + other.y, self.x + other.x)
9
10
def __sub__(self, other):
11
return YX(self.y - other.y, self.x - other.x)
12
13
def __str__(self):
14
return 'Y:%s,X:%s' % (self.y, self.x)