game-ai

Implementing and using MinMax with four in row (connect4) game

只谈情不闲聊 提交于 2019-12-08 03:33:00
问题 I'm trying to implement the MinMax algorithm for four in a row (or connect4 or connect four) game. I think I got the idea of it, it should build a tree of possible boards up to a certain depth, evaluate them and return their score, then we just take the max of those scores. So, aiChooseCol() checks the score of every possible column by calling MinMax() and returns the column with the max score. Now I wasn't sure, is this the right way to call MinMax() ? Is it right to check temp = Math.Max

AI algorithm for “RaceTrack” game

て烟熏妆下的殇ゞ 提交于 2019-11-30 01:54:21
does anyone know (or can suggest) a good algorithm for an AI for the RaceTrack pencil-paper game? since you have 9 possible choices in each step and you need to look at least 6-10 steps ahead to decide on a good strategy, bruteforce is getting very expensive even if you can rule out some choices because of intersection with the boundary. Currently I'm trying to assign each choice some quality value in order to decide which choices to rule out - but I don't know good rules yet on how to assign such a quality value. I have made a C++ solver that's a bit too long (187 lines) to fit comfortably

AI algorithm for “RaceTrack” game

╄→尐↘猪︶ㄣ 提交于 2019-11-28 22:43:05
问题 does anyone know (or can suggest) a good algorithm for an AI for the RaceTrack pencil-paper game? since you have 9 possible choices in each step and you need to look at least 6-10 steps ahead to decide on a good strategy, bruteforce is getting very expensive even if you can rule out some choices because of intersection with the boundary. Currently I'm trying to assign each choice some quality value in order to decide which choices to rule out - but I don't know good rules yet on how to assign