In Chapter 8, Learning Techniques, we learned how N-Grams is a probabilistic language model for predicting the next item in a sequence of n-1 elements, and how it can be applied in learning techniques for predicting player behavior. However, it can also be used for procedural content generation—creating new elements by imitating the style of a given set.
In this recipe, we will use the power of N-Grams for creating new levels from a given set, thus imitating the style of the designer.