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

Bitwise trophy states #5

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Bitwise trophy states #5

merged 1 commit into from
Dec 7, 2023

Conversation

Jm15itch
Copy link
Contributor

@Jm15itch Jm15itch commented Dec 7, 2023

I converted the array that held the states of the collected trophies into a bitwise+macros version. I believe it might look better and it saves on 11 bytes :)

Changed the array of trophy states into a bitwise state.
@mrbid
Copy link
Owner

mrbid commented Dec 7, 2023

that's really cool i love it, i always talk about how much i like the idea of using bits to store boolean states but never use the technique myself in practise, nice to see you again btw i hope you have a wonderful holiday as we approach the end of the year 🥳 in a way this is a lovely present to have received to this repository, thank you!

@mrbid mrbid merged commit f2107ba into mrbid:main Dec 7, 2023
@mrbid
Copy link
Owner

mrbid commented Dec 7, 2023

I just want to add this encase anyone else comes across this, as I was unaware of this but the 0b1 is a method of passing binary digits very briefly explained here: https://gcc.gnu.org/onlinedocs/gcc/Binary-constants.html

And to quickly decode bit-wise operations this Wikipedia article is an efficient reference guide: https://en.wikipedia.org/wiki/Bitwise_operations_in_C

That's really cool.

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.

2 participants