Spelunky

Spelunky is a roguelike game released in 2008. The goal of the game is to travel through 16 procedurally generated levels and defeat the main bosses. Because the levels are procedurally generated, each playthrough of the game is slightly different.

Here we will see a little bit of how the generating algorithm works.

Rooms
Each level in Spelunky is made of 16 "rooms" arranged in a 4x4 grid. There are four basic types of rooms:
 * Type 0: Rooms not on the solution path (explained below).
 * Type 1: Rooms with left and right exits.
 * Type 2: Rooms with left, right, and bottom exits. If the room above this one is type 2, then this room will also have a top exit.
 * Type 3: Rooms with left, right, and top exits.

Room Creation and Placement
The aim of the algorithm is to create a solution path, which is a series of rooms through which the player can reach the exit.
 * First, the start room is placed somewhere on the top row. It's either a Type 1 or Type 2 room.