Robotic Arm tic tac toe?

I will be printing out a 5 servo robotic arm soon and am currently wondering how possible it would be to code it to perform tic tac toe or other games. I understand about the use of minimax for the move choosing and want to use a keypad to input the move the human made.
I am stuck on how to program such, would the keypad move be sent to the Arduino, then minimax would decipher the next move, then I would need to have stored positions for the arm to move.

Such as

If(key=4)
Servowrite(90) //and so on for the positioning?

Any input or help would be appreciated, also if this is too complicated would there be any other things to do with a robotic arm? I may doing this for a project at school.

If(key=4)Maybe spend a bit longer on the basics

Instead of making your Robotic Arm play Tic Tac Toe, you should think of some simple application, like Pick & Place type. Pick some object from position A and then place it at position B in some basket.

I am also working on a similar project, I have designed the robotic hand and I am also done with controlling its simple movements. Here’s the video of my robotic arm: Robotic Arm Control using Arduino Nano - YouTube This one is using 6 Servo Motors. My next task is to make this pick and place code.

AWOL:

If(key=4)

Maybe spend a bit longer on the basics

Here is some potentially more useful information.

https://www.includehelp.com/c-programming-questions/what-is-difference-between-assignment-and-equalto-operator.aspx

https://playground.arduino.cc/Main/KeypadTutorial

Thanks! I was also thinking about doing something with one Steph like rock paper scissors but I would need a whole hand for that.

You may need "inverse kinematics" to calculate the servo moves for e.g. drawing an X or O. Or you use kind of teach-in, where you make the arm move as desired by remote control, and record all steps taken.

Yeah, I couldn't get it to work so I am trying to make a robotic arm use color sensors instead.