projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add boop when changing actions
[naja.git]
/
naja
/
player.py
diff --git
a/naja/player.py
b/naja/player.py
index 00e6133ed720486bd19d878136abcdcd5087b86a..f502b640ffd94ddd999022931425e77248794141 100644
(file)
--- a/
naja/player.py
+++ b/
naja/player.py
@@
-92,6
+92,12
@@
class Player(object):
return True
return False
return True
return False
+ def set_position(self, new_position):
+ if new_position in self.legal_moves():
+ self.position = new_position
+ return True
+ return False
+
def legal_moves(self):
positions = [self.position]
for direction in [BITS.NORTH, BITS.SOUTH, BITS.EAST, BITS.WEST]:
def legal_moves(self):
positions = [self.position]
for direction in [BITS.NORTH, BITS.SOUTH, BITS.EAST, BITS.WEST]: