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

✨ Add maze generation feature #90

Merged
merged 21 commits into from
Sep 10, 2024
Merged

✨ Add maze generation feature #90

merged 21 commits into from
Sep 10, 2024

Conversation

bal7hazar
Copy link
Collaborator

Closes #

Introduced changes

  • Add algo to generate a maze into a felt252

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 marked this pull request as ready for review August 28, 2024 22:34
@bal7hazar bal7hazar requested a review from glihm August 28, 2024 22:34
crates/maze/src/maze.cairo Outdated Show resolved Hide resolved
Copy link
Contributor

@glihm glihm left a comment

Choose a reason for hiding this comment

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

Looking great!

Some comments, and more generally:

  1. Would be great to have an explanation of the differences between a room, a cave and a maze. For a better understanding of the terms used.
  2. As generate_trait is used, having a doc on the function could help one diving and re-using this code base to apply it in different games.

Amazing work @bal7hazar. 🚀

crates/map/src/cave.cairo Outdated Show resolved Hide resolved
crates/map/src/cave.cairo Outdated Show resolved Hide resolved
crates/map/src/cave.cairo Outdated Show resolved Hide resolved
@bal7hazar bal7hazar marked this pull request as draft September 4, 2024 15:13
@bal7hazar
Copy link
Collaborator Author

I have performed a big refactoring which should allow developers to either use the high level usage Room to generate rooms or use directly the raw algorithms located in the helpers folder.

I have added a bunch of doc in the code, but I could have miss some and maybe not detailed enough, just tell me if something is unclear.

@bal7hazar bal7hazar requested a review from glihm September 5, 2024 17:44
@bal7hazar bal7hazar marked this pull request as ready for review September 5, 2024 17:45
Copy link
Contributor

@glihm glihm left a comment

Choose a reason for hiding this comment

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

@bal7hazar thanks for this great effort on documentation and bringing this to origami!

I've made some comments say are not forced to be addressed here since the usage of the functions is controlled. May be addressed later to not relay the work on the other PR that uses this one. Feel free to merge if so.

Also, I was wondering at first why not using a more object oriented approach but I guess it's way more optimized gas wise doing the way you did it.

Amazing job. 💪

crates/map/src/helpers/bitmap.cairo Show resolved Hide resolved
crates/map/src/helpers/bitmap.cairo Show resolved Hide resolved
crates/map/src/helpers/digger.cairo Outdated Show resolved Hide resolved
@bal7hazar bal7hazar merged commit 9e1f51b into main Sep 10, 2024
10 checks passed
@bal7hazar bal7hazar deleted the feat/maze branch September 10, 2024 16:04
bal7hazar added a commit that referenced this pull request Sep 10, 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.

3 participants