diff --git a/README.md b/README.md index 478da54..dc24a31 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ When running the application you can press the N key to start a new g of the current piece, and Space drops it to the bottom of the well instantly. A small shadow tetrad at the bottom of the well indicates where the current piece will fall. -Tetrys requires [Python 2.7](http://www.python.org/download/releases/2.7/) and [pygame](http://www.pygame.org/). +Tetrys requires [Python](http://www.python.org/) and [pygame](http://www.pygame.org/). ![](https://foosoft.net/projects/tetrys/img/tetrys.png) diff --git a/tetrys.py b/tetrys.py index 39d2e23..857b643 100755 --- a/tetrys.py +++ b/tetrys.py @@ -35,8 +35,8 @@ class Tetrad: layout = list() mask = self.block_configs[self.config][1] >> (16 * self.rotation) - for bit in xrange(16): - position = bit % 4, bit / 4 + for bit in range(16): + position = bit % 4, bit // 4 if mask & (1 << bit): layout.append((self.position[0] + position[0], self.position[1] + position[1])) @@ -60,7 +60,7 @@ class Tetrad: def centered(self, width): - return Tetrad((width / 2 - 2, 0), self.config, self.rotation) + return Tetrad((width // 2 - 2, 0), self.config, self.rotation) @staticmethod @@ -113,8 +113,8 @@ class Board: def render_blocks(self, surface): - for y in xrange(self.grid_dims[1]): - for x in xrange(self.grid_dims[0]): + for y in range(self.grid_dims[1]): + for x in range(self.grid_dims[0]): self.render_block(surface, self.blocks[y][x], (x, y))