Sitelet https://github.com/dojoengine/origami/pull/102
Skip to content

feat: breadth-first search algorithm - #102

Merged
bal7hazar merged 5 commits into
dojoengine:mainfrom
okhaimie-dev:bfs-impl
Oct 8, 2024
Merged

bal7hazar merged 5 commits into
dojoengine:mainfrom
okhaimie-dev:bfs-impl

Conversation

@okhaimie-dev

@okhaimie-dev okhaimie-dev commented Sep 17, 2024 •

Copy link
Copy Markdown
Contributor

Closes #96

Introduced changes

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Add a dedicated CI job for new examples
  • Performed self-review of the code

@bal7hazar bal7hazar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!
I took the liberty of making few modifications to simply the code such as:

  • Switch from loop to while loops when possible
  • Remove the Queue type which was just an Array wrapper
  • Shuffle the directions when checking neighbors to avoid having hard coded patterns in game (like if the next move can either be North or West, we don't want it to be always North for instance but pseudo randomly one of those).
  • Fixed a test where the grid was not the same as the comment

@bal7hazar
bal7hazar merged commit bbf69dc into dojoengine:main Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Breadth-First Search pathfinding algorithm

2 participants