2024
Advent of Code 2024
Advent of Code 2024 started today. This is my fifth year participating. Previous years were: 2020, 2021, 2022 and 2023.
Although I primarily use Racket for software development, I'll be using Python this year to gain proficiency with the language in preparation for future data science and artificial intelligence work.
Chess: generating moves
Generating Moves
Part of the How to Program a Chess Engine in Lisp series.
This post will cover basic game state and move generation.
Chess: the chess move
The Chess Move
Part of the How to Program a Chess Engine in Lisp series.
This post will cover the following tasks, in preparation for generating chess moves:
- A macro for conveniently encoding fields in a fixnum integer
- An efficient encoding of a chess move
- Basic game state
Chess: Forsyth-Edwards Notation
FEN - Forsyth-Edwards Notation
Part of the How to Program a Chess Engine in Lisp series.
Now that we have pieces and a board, we need a convenient way of setting pieces on the board in specific positions. We'll use this, not only for the initial position of a game, but also to configure a board with specific game scenarios for testing and debugging.
The standard way to do this is to use FEN, or Forsyth-Edwards Notation: [Wikipedia] [Chess Programming Wiki]
Here is the source for fen.rkt
Chess: the chess board
The Chess Board
Part of the How to Program a Chess Engine in Lisp series.
One of the most significant design decisions for a chess engine is how to model the chess board. I think the most competitive engines use a bitboard representation; however, for our purposes, a mailbox representation is more intuitive and easy to visualize. In particular, we will use a 10 x 12 board.
Here is the source for board.rkt