Comments (2)
In your code, the gridBackup
is dirty when the findThePath
function is called for the second time. So the subsequent calls to findThePath
will not return the correct answer.
To correct it, you should make a clone of the grid every time before the pathfinding. See Line 17 of my modified version: http://jsfiddle.net/UYyQM/1/
from pathfinding.js.
Oh excellent! I don't know why that works, but it does. Much thanks to
you for the help. :) You've offered up a great script.
On Wed, May 22, 2013 at 6:05 PM, Xueqiao Xu [email protected]:
In your code, the gridBackup is dirty when the findThePath function is
called for the second time. So the subsequent calls to findThePath will
not return the correct answer.To correct it, you should make a clone of the grid every time before
the pathfinding. See Line 17 of my modified version:
http://jsfiddle.net/UYyQM/1/—
Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-18317919
.
from pathfinding.js.
Related Issues (20)
- The PF.Grid(matrix) didn't worked for me HOT 1
- unexpected route HOT 1
- Allow Diagonal set to false HOT 1
- Show algorithm analytics before visualization is completed
- smoothenPath ignores dontCrossCorners
- Error: TypeError: Cannot set properties of undefined (setting 'g') HOT 1
- TypeError: Cannot read properties of undefined (reading 'x') HOT 2
- Solve maze produced by https://github.com/bestguy/generate-maze HOT 2
- How to draw the SVG path from the path array returned by the algorithm? HOT 8
- Adding water blocks HOT 1
- Path going straight through Towers (11111)
- two or more end tiles
- Problem 7 HOT 1
- Using Grid with - coordinates HOT 1
- Obtain the matrix from the pathfind grid
- 3D Pathfinding Demos or Documentations? HOT 3
- Unable to find multiple paths with same startNode
- TypeError: Cannot read properties of undefined (reading '6') HOT 1
- Solve on every pointerup
- All the docs images are broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathfinding.js.