{"id":17283703,"url":"https://github.com/prettymuchbryce/goeasystar","last_synced_at":"2025-03-26T16:16:18.544Z","repository":{"id":66163042,"uuid":"42079040","full_name":"prettymuchbryce/goeasystar","owner":"prettymuchbryce","description":"An A* pathfinding library written in Go.","archived":false,"fork":false,"pushed_at":"2015-09-07T23:50:56.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T16:55:46.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettymuchbryce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-07T23:25:47.000Z","updated_at":"2021-03-10T17:48:15.000Z","dependencies_parsed_at":"2023-02-19T23:25:25.476Z","dependency_job_id":null,"html_url":"https://github.com/prettymuchbryce/goeasystar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fgoeasystar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fgoeasystar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fgoeasystar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fgoeasystar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettymuchbryce","download_url":"https://codeload.github.com/prettymuchbryce/goeasystar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689509,"owners_count":20656417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T09:51:59.561Z","updated_at":"2025-03-26T16:16:18.512Z","avatar_url":"https://github.com/prettymuchbryce.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goeasystar\n\nA port of [EasyStar.js](http://www.easystarjs.com) to the Go programming language.\n\n##Installation\n```\ngo get github.com/prettymuchbryce/goeasystar\n```\n\n##Documentation\n[GoDoc](https://godoc.org/github.com/prettymuchbryce/goeasystar)\n\n## API\n\n#### Main Methods\n\n```go\neasystar := goeasystar.NewPathfinder()\n```\n\n```go\neasystar.SetGrid(grid [][]int)\n```\n\n```go\neasystar.SetAcceptableTiles(t []int)`\n```\n\n```go\neasystar.FindPath(startX, startY, endX, endY) ([]*goeasystar.Point, error)\n```\n\n#### Additional Features\n\n* Avoiding additional points (outside of acceptable tiles)\n\n* Diagonals\n\n* Corner cutting\n\n* Setting costs per-tile\n\n* Setting additional point costs (outside of tile costs)\n\n## Usage\n\nFirst create an instance of the Pathfinder.\n\n```go\neasystar := NewPathfinder()\n```\n\nCreate a grid, or tilemap. You may have made this with a level editor, or procedurally. Let's keep it simple for this example.\n\n```go\nvar grid [][]int\ngrid = append(grid, []int{1, 0, 0, 0, 0})\ngrid = append(grid, []int{0, 1, 0, 0, 0})\ngrid = append(grid, []int{0, 0, 1, 0, 0})\ngrid = append(grid, []int{0, 0, 0, 1, 0})\ngrid = append(grid, []int{0, 0, 0, 0, 1})\n```\n\nSet our grid.\n\n```go\neasystar.SetGrid(grid)\n```\n\nSet tiles which are \"walkable\".\n```go\neasystar.SetAcceptableTiles([]int{1})\n```\n\nFind a path.\n\n```go\npath, err := easystar.FindPath(0, 0, 4, 4)\nfmt.Println(err == nil) // false\n```\n\nOops. We didn't have diagonals enabled so there is no valid path. Lets try again.\n\n```go\neasystar.EnableDiagonals()\npath, err := easystar.FindPath(0, 0, 4, 4)\nfmt.Println(err) // nil\nlen(path) // 4\n```\n\n## License\n\ngoeasystar is licensed under the MIT license.\n\ngoeasystar uses facebookgo's [pqueue](http://www.github.com/facebookgo/pqueue) which falls under the Apache 2 License.\n\nI would be happy to eventually remove it in favor of an MIT-licensed priority queue implementation.\n\n## Support\n\nIf you have any questions, comments, or suggestions please open an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Fgoeasystar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettymuchbryce%2Fgoeasystar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Fgoeasystar/lists"}