How does minecraft generate endless worlds?

I know they're not endless but they are HUGE, because while you go in a direction its generating land, until it gets glitchy or something (haven't played pc version).

How do they do that? What's it called? How do I learn to do that on a computer language? How complicated is it? And can any language do that? (if not, which ones do?)

Hi, to answer your question, I definitely recommend using a game creation software called Unity 4 to create a game with similar infinite features to Minecraft. I'm not really sure how to do that but I have enclosed a link to a Youtube video that guides you through the process of creating an endless world using Unity 3D.

I believe various compression techniques are used.

I don't know that there's a specific name for it, but it's pretty simple…

The world is broken up into chunks, I believe these are 64x64 in Minecraft… So you really only need to see the current chunk you are in, and the 8 surrounding chunks (view distance will prevent you from seeing more than that).

So, whenever a player enters a new chunk… You load the 8 chunks around it, and if one doesn't exist (hasn't been generated yet), you generate it. This keeps the world around the player always available… Also any loaded chunks that are no longer immediately around the player location get unloaded (they are saved so they don't have to be regenerated next time they are needed).

It generates as you walk, it certainly is endless(the pc version is atleast) as its like your brain, you're learning and it adds to your memory, your brain can hold an endless amount of stuff. Code wise its pretty simple, you just input code that tells the computer to randomly generate randomly while maintaining dirt always on top.
computer make a random decision easily