Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: breadth-first search algorithm #102

Merged
merged 5 commits into from
Oct 8, 2024

Conversation

okhaimie-dev
Copy link
Contributor

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

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

Copy link
Collaborator

@bal7hazar bal7hazar left a comment

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
10 checks passed
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