summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatts1 <mattstark75@gmail.com>2013-03-24 20:18:33 +1100
committermatts1 <mattstark75@gmail.com>2013-03-24 20:18:33 +1100
commit7d864bbc93bb0497bb06deb2a6a6ccf49dea06c5 (patch)
tree14ff10e278247954b6cb4a912ec94d5d24247916
parent7af7c2db8d3eccd0ce6cbfe69635833b5aff6a98 (diff)
modified code to fit style guide
-rw-r--r--snakegame/engine.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/snakegame/engine.py b/snakegame/engine.py
index 86e1cc9..a0d1d4a 100644
--- a/snakegame/engine.py
+++ b/snakegame/engine.py
@@ -15,8 +15,8 @@ HARD_TIME_LIMIT = 1.0
class Engine(object):
def __init__(
self,
- rows, columns, n_apples, n_ice_creams=0,
- n_shrink_potions=0, n_walls=0,
+ rows, columns, n_apples,
+ n_ice_creams=0, n_shrink_potions=0, n_walls=0,
wrap=True,
random=None,
*args, **kwargs
@@ -30,8 +30,10 @@ class Engine(object):
self.wrap = wrap
self.bots = {}
- self.new_game(rows, columns, n_apples, n_ice_creams,
- n_shrink_potions, n_walls)
+ self.new_game(
+ rows, columns, n_apples,
+ n_ice_creams, n_shrink_potions, n_walls,
+ )
def get_random_position(self):
x = self.random.randrange(0, self.columns)
@@ -50,8 +52,11 @@ class Engine(object):
x, y = self.get_random_position()
self.board[y][x] = item
- def new_game(self, rows, columns, n_apples, n_ice_creams,
- n_shrink_potions, n_walls):
+ def new_game(
+ self,
+ rows, columns, n_apples,
+ n_ice_creams, n_shrink_potions, n_walls,
+ ):
self.game_ticks = 0
self.game_id = self.random.randint(0, sys.maxint)