Answer: An algorithm
Explanation: Computer programs are algorithms. They are finite set of rules or instructions carefully written to perform a specific task. The algorithm is written in a flexible manner without the moves being 'hard-coded', This allows the program to adjust and routinely calculate all possible game moves.
Hard coding the moves reduces the flexibility of the algorithm. Hard coding is used when there is something we want to embed within our program permanently without being changed.
The algorithm only states the rules of the game, without the limiting the moves a player can make.