How to make generation extend to a certain amount

It’s kind of hard to explain in the title, but I’ll explain it here.

So I made this minecraft-like blocky terrain generation script and it works all right, but what I wanted to do is to make the bottom extend to a certain point.

Example:
image

At the bottom, it’s just weird.

What I want:

Any help would be appreciated.