BreadMoirai/DiscordSamuraiBot

minmax algorithm for connect 4

Opened this issue · 2 comments

It's actually a maxmax algorithm right now since I didn't put any thought into it. There's a strategy pattern in place cuz it's a bot strategy so the algorithm needs to be improved from MinimaxStrategy.java to something better like RealMinMaxStrategy.java

Package is samurai.messages.dynamic.duel.strategy

so the minimax algorithm is still a bit wonky but it is more than adequate for the average player. Solved this by assuming that 'b' is always Samurai and adjusting values to doubles, removing rounding errors.