How would i make a world generation script like minecraft but in... 2d?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MrBucket

So I am working on a game that is basically Minecraft for pirates, and I want to randomly generate terrain, but unfortunately it seems that i have no idea what certain keywords I need to type in to get the correct tutorial, so let me do my best to explain what I want to do. I have multiple tile maps for layering, and I want to make a world generation system where grass goes on top, and dirt below it, and grass and dirt are in random 3-7 long tiles of them, and then it either goes up 1, or down 1. I for now just need a simple generating one, nothing too special, just a world generation for 2d tile maps. I’m sure this will come in handy for other people who may be as stupid as me to try to make a game after only learning a language after 1 day, also sorry for such a long question, and if I came off rude, I’m sorry. Its 3 am in the morning, and the only thing I can think of is finishing my game. And yes, I know its bad for me, and I will stop it. Thanks to everyone who helps.
I don’t need a script, just something to explain to me how to do it so that then I don’t just repeat other devs and copy and paste code and not learn anything(At least from what I know) .

:bust_in_silhouette: Reply From: Inces

I think this is the best creator on such matters, he has whole series about this kind of random generation :