3 ms·
> The most novel aspect of OoT bitsets is that the first 4 bits in the 16-bit coordinate IDs index which bit is set. For example, 0xA5 shows that the 5th bit is
by orlp 1y ago
> The most novel aspect of OoT bitsets is that the first 4 bits in the 16-bit coordinate IDs index which bit is set. For example, 0xA5 shows that the 5th bit is set in the 10th word of the array of 16-bit integers. This only works in the 16-bit representation! 32 bit words would need 5 bits to index the bit, which wouldn't map cleanly to a nibble for debugging.
There is nothing novel about this really. It's neat that it works with hexadecimal printing to directly read off the sub-limb index but honestly who cares about that.
Outside of that observation there's no advantage to 16-bit limbs and this is just a bog-standard bitset where the first k bits indicate the position within the 2^k bit limb, and the remaining bits give you the limb index.
- jb55 1y agoupdated for the hacker news crowd https://github.com/jb55/oot_bitset#:~:text=Hacker%20news%20folks%20say%20this%20is%20not%20that%20new%20or%20interesting%2C%20but%20I%20thought%20it%20was!%20I%20hope%20some%20others%20find%20it%20interesting%20as%20well. https://github.com/jb55/oot_bitset#:~:text=Hacker%20news%20f...
- lpribis 1y agoHaha, good to take the classic HN condescension on the chin ;)
- TimorousBestie 1y agoFor what it’s worth, I found it interesting. I like your verve.
- orlp 1y agoMy comment was worded a bit too harshly, sorry about that, I certainly wouldn't have worded that way in a personal message. As I mentioned the hexadecimal printing coincidence is a neat fact, I was just excited when clicking the link to find a novel bitset idea. In my disappointment to find the standard bitset (albeit with 16-bit limbs) I reacted a bit too harshly. And as per https://xkcd.com/1053/ https://xkcd.com/1053/, just because something isn't new to me doesn't mean it's not new to anyone.