Board game algorithm | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Board game algorithm

how can I make computer think and play in simple board game?

27th Jan 2018, 2:05 PM
Abdurrahman Abulgasim
Abdurrahman Abulgasim - avatar
2 Answers
+ 6
If you want a simple case, try to reward and/or penalize for different choices or move settings. If you want a real AI mechanism, you most likely should employ machine learning algorithms tuned to the board game rules and run it a couple of hundred thousand times :)
27th Jan 2018, 2:19 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 5
Well, I remember programming in high school and making a "checkers" game. I rewarded the computer opponent for taking out my checkers and penalized it for giving me a chance to take out its own checkers in my next move. Also, I rewarded it *big* for reaching my base which resulted in the AI getting the "superchecker". Based on the potential points for every move, the computer made decisions which checker to move and what to do with it. Of course, it was pretty predictable and prone to set-ups :) but still better than random, eh? ;)
27th Jan 2018, 7:41 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar