Marching Squares is an algorithm that is often used for terrain generation.
In my demo I am only using one layer (0's and 1's). 1 being ground and 0 being empty space.
I will most likely create another demo with multiple layers (water, dirt, grass) at a later time.
Created and added a video tutorial explaining how the algorithm work, while implementing it.
Video Tutorial:

Source code to a more advanced demo here.
If you find it useful, star it and let me know! Motivation is always helpful :)