A gaming machine comprises at least one visual display (mechanical or video) and a game of chance controlled by a processor in response to a wager. The game of chance includes a primary game and a sorting feature. The sorting feature is triggered by certain start-feature outcomes of the primary game. The sorting feature includes a collection of scrambled objects, such as letters, symbols, pictures, or puzzle pieces, that are at least partially sorted during operation of the sorting feature. The sorting feature generates an award, such as a payoff, a payoff multiplier, or extended play, if the sorted objects match predetermined criteria.