min max algorithm for dots an boxes

I’m trying to implement an AI that uses Minimax for the dots and boxs game

I have finished the first part of implementing the game for 2 players offline.

now I need to make it against the computer .

actually I’m new in the AI and this is my fist game ,so after some research

I found that the best algorithm used for this game is min max .
I have an idea about min max as an algorithm but i have no idea how to adopt it to my code.
can anyone explain to me how it works!

Hey did you manage to implement the algorithm?