[DiscordArchive] Hole algorithm?
[DiscordArchive] Hole algorithm?
Archived author: Nix • Posted: 2022-11-17T00:20:58.617000+00:00
Original source
Hole algorithm?
Archived author: Titi • Posted: 2022-11-17T00:26:37.819000+00:00
Original source
well maybe algorithm isn't really the word for it, more like pattern ?
this is my code for finding WDL holes
```c++
for (int i = 0; i < 16; ++i)
{
std::bitset<16>wdlHoleMask(0);
for (int j = 0; j < 16; ++j)
{
auto chunk = mTile->getChunk(j, i);
// the ordering seems to be : short array = Y axis, flags values = X axis and the values are for a whole chunk.
std::bitset<16> holeBits(chunk->getHoleMask());
if (holeBits.count() == 16) // if all holes are set in a chunk
wdlHoleMask.set(j, true);
}
auto convertedholemask = (short)wdlHoleMask.to_ulong();
wdlFile.Insert(mareoffset, 2, (char*)&convertedholemask);
mareoffset += 2;
}
```
![[Image: image.png?ex=690c953d&is=690b43bd&hm=3bb...4911ca48c&]](https://cdn.discordapp.com/attachments/408013572430626817/1042597933826183188/image.png?ex=690c953d&is=690b43bd&hm=3bbb09d991257c54f254ecdf23e18d633cf57a0c077cc331733ba3f4911ca48c&)
Archived author: ReynoldsCahoon • Posted: 2022-11-17T00:31:58.028000+00:00
Original source
Not sure if you're aware you can use 3 back ticks followed by a language abbreviation and three more back ticks at the end of your code to create a proper code block with syntax highlighting.
![[Image: image.png?ex=690c953d&is=690b43bd&hm=3bb...4911ca48c&]](https://cdn.discordapp.com/attachments/408013572430626817/1042597933826183188/image.png?ex=690c953d&is=690b43bd&hm=3bbb09d991257c54f254ecdf23e18d633cf57a0c077cc331733ba3f4911ca48c&)
Archived author: Nix • Posted: 2022-11-17T01:24:04.229000+00:00
Original source
Seems pretty standard, gj though. It's really nice to see progress