Introduction

Chess is a game with over a century of history, famous for its strategic depth and for exercising concentration and logical thinking. Its first unofficial "Olympiad" took place in Paris in 1924 as part of the World Championship of Nations, establishing its international recognition.

Beyond being entertainment, chess offers endless possibilities for analysis, where every move can change the course of the game. In this section, we explore it from a computational perspective, seeking the fewest moves that lead to an imminent victory.

Chess is not just a pastime or a sport: it is also a cultural, mathematical, and technological phenomenon. A 64-square board can contain more possibilities than the atoms in the observable universe.

History of chess

Modern chess is believed to originate from Chaturanga, a game that emerged in India around the 6th century A.D., which already included pieces and concepts similar to those of modern chess. Between the 7th and 9th centuries, it spread to Persia as Shatranj, and later reached Europe during the Middle Ages. Between the 15th and 16th centuries, it evolved to adopt the current rules, including significant changes such as the movements of the queen and bishop.

Although the history of chess is very ancient and difficult to verify, we can affirm that competitive chess, as we know it today, did not always have formal championships and began to develop from the 19th century:

  • Before the 19th century: Chess was played mainly informally, in cafés and among circles of enthusiasts, although local tournaments and documented matches existed since the 16th century.

  • 1851: First recognized international tournament, organized in London by Howard Staunton. This event marked a milestone in the history of competitive chess by unifying rules and playing styles.

  • 1886: First official World Chess Championship, between Wilhelm Steinitz and Johannes Zukertort. Steinitz was crowned as the first officially recognized world champion.

  • 1924: First unofficial "Chess Olympiad," held in Paris as part of the World Championship of Nations. That same year, the FIDE (International Chess Federation) was founded to regulate official competitions and award titles such as International Grandmaster.

Since then, chess has experienced great moments:

  • 1972: Fischer vs Spassky was much more than a match: during the Cold War it became a cultural and political symbol, as Bobby Fischer broke decades of Soviet dominance, sparking global interest in chess.

  • Recent decades: figures such as Karpov, Kasparov, and Carlsen have elevated the strategy and popularity of the game, contributing unique styles and keeping competitive chess alive worldwide.

Today, thanks to the internet and technology, millions of games are played online every day, and artificial intelligence engines have taken competition to extraordinary levels.

Chess as a mathematical object

The board seems simple: 8 rows × 8 columns, 64 squares, but the possibilities are enormous.

Each piece has specific movement rules. Claude Shannon calculated in 1950 that the number of legal possible games is on the order of 10^120.

For comparison:

  • The observable universe has approximately 10^80 atoms.
  • Chess exceeds that number in possible combinations.

This phenomenon is represented as a decision tree: each move opens several branches, multiplying with each turn. After just 4 moves per player, there are already over 300,000 distinct positions.

How machines think about chess

When a computer plays chess, it does not "think" like a human; it traverses a tree of moves:

  • The opening usually has about 20 legal options.
  • The opponent's response multiplies the possibilities.
  • The tree grows rapidly, and no computer can explore it completely.

Chess engines use algorithms such as:

  • Minimax: seeks to maximize winning opportunities while the opponent tries to minimize them.
  • Alpha-beta pruning: discards irrelevant branches, saving millions of calculations.

Practical example: knight moves:

def knight_moves(x, y):
    offsets = [(2,1), (1,2), (-1,2), (-2,1),
              (-2,-1), (-1,-2), (1,-2), (2,-1)]
    moves = []
    for dx, dy in offsets:
        newX = x + dx
        newY = y + dy
        if 0 <= newX < 8 and 0 <= newY < 8:
            moves.append((newX, newY))
    return moves

The artificial intelligence revolution

Chess and artificial intelligence have had a special relationship:

  • 18th century: The Mechanical Turk amazed Europe (though it hid a human operator).
  • 1997: Deep Blue defeats Garry Kasparov, then world champion.
  • 2017: AlphaZero learns chess from scratch, surpassing the best traditional engines within hours.

AlphaZero displayed a creative, aggressive, and "human-like" style, showing that even machines can surprise us.

Exercises to explore

Chess is better understood through practice:

  1. Explore the knight: place it on different squares and count its possible moves.
  2. Calculate opening branches: how many positions arise after 2 moves per player?
  3. Mini programming project: create a function that calculates a pawn's possible moves, considering its 2 initial options.

These exercises show that chess combines logic, strategy, and creativity.

Conclusion

Chess is history, art, mathematics, and technology. It began as a military strategy game, became a universal sport, and today is also a field of experimentation for artificial intelligence.

Its magic lies in the fact that, despite all the computing power of modern machines, chess still leaves room for human creativity. A child learning to move the pieces today can, with ingenuity and passion, surprise the most powerful computer.

Chess: a game finite in rules, but infinite in possibilities.