This is some sample code for some cellular automata based generation I've been working on in Godot for the last couple of days.
It probably won't work if just dropped into your project but it should give a good reference for doing something similar.
using System;