git.ucc.asn.au
/
progcomp2012.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated graphics to for displaying on the clubroom projector
[progcomp2012.git]
/
agents
/
asmodeus
/
path.py
diff --git
a/agents/asmodeus/path.py
b/agents/asmodeus/path.py
index
3f08979
..
3a4527e
100644
(file)
--- a/
agents/asmodeus/path.py
+++ b/
agents/asmodeus/path.py
@@
-32,7
+32,7
@@
class PathFinder:
up = (start[0], start[1]-1)
down = (start[0], start[1]+1)
choices = [left, right, up, down]
up = (start[0], start[1]-1)
down = (start[0], start[1]+1)
choices = [left, right, up, down]
- choices.sort(key = lambda e :
random.randint(0,5)
)
+ choices.sort(key = lambda e :
(e[0] - end[0])**2.0 + (e[1] - end[1])**2.0
)
options = []
for point in choices:
option = [point, self.pathFind(point,end,board)]
options = []
for point in choices:
option = [point, self.pathFind(point,end,board)]
UCC
git Repository :: git.ucc.asn.au