Skip to content

A port of the JS EasyStar (A* - Dijkstra) package to Smalltalk

Notifications You must be signed in to change notification settings

psvensson/Easystar-st

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easystar-st

A port of the JavaScript EasyStar package (A* - Dijkstra) package to Smalltalk.

Loading

Metacello new
    repository: 'github://psvensson/Easystar-st:master';
    baseline: 'Easystar';
    load

Using

Here is a unit test that show how to set up and call Easystar (For more complex examples see the other unit tests in the package);

testFindPath
	| easyStar map |
	easyStar := EasyStar new. 
	map := #((1 1 0 1 1)
		 (1 1 0 1 1)
		 (1 1 0 1 1)
		 (1 1 1 1 1)
		 (1 1 1 1 1)).
	easyStar setGrid: map.
	easyStar acceptableTiles: { 1 }.
	easyStar avoidAdditionalPointX: 3 y: 4. 
	easyStar findPathFrom: 2@3 to: 4@3 onPathFound: [ :path |
		self assert: path isNotNil.
		self assert: path size equals: 7.
		self assert: (path at: 1) x equals: 2.
		self assert: (path at: 1) y equals: 3.
		self assert: (path at: 3) x equals: 2.
		self assert: (path at: 3) y equals: 5 ]. 
	easyStar calculate.  

About

A port of the JS EasyStar (A* - Dijkstra) package to Smalltalk

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages