This is an implementation of the "cellular automata" algorithm using three fillings, represented as white, blue, and black. The goal is to generate reasonable-looking caves or pathways that could be used as terrain in a game.
I used an implementation using just two kinds of filling as inspiration.