This is a somewhat simple implementation of the Minecraft's "Jigsaw" structure generation algorithm. The inspiration is taken from this video.
dog-m/worldgen-2d-jigsaw-playground
Barebones unoptimized C++ implementation of the "Jigsaw" algorithm
C++GPL-3.0