In most chess engines, a searching algorithm along with a heuristic function gives the chess AI the main insight into the best moves to play. The bulk of the programming and most of the “brains” behind this is the heuristic function.

What do I mean by heuristic function? Heuristic function refers to a function that takes certain measurements of the chessboard, gives each measurement a certain weightage, and finally calculate a numerical value of the advantage of each player. The heuristic function in chess usually considers basic things such as pawn structure, center control, and King safety, but it can also include more complex calculations such as tempo and opportunities to employ different tactics.

A well-seasoned chess player with a decent proficiency in programming would be able to construct a good heuristic function. Unfortunately, I am not that well-seasoned chess player. I have decided to use a neural network to create a heuristic function for me.

## Concept:

The concept of the program uses a neural network to evaluate the board, which is then fitted with the search algorithm, which checks all future position and finds the highest value, sort of like a min-max tree.

## Program:

### Step 1- Accessing the Data:

``````from pandas import read_csv
import numpy as np
import chess
import os