On Sat, Aug 18, 2018 at 2:56 PM John <markfe...@gmail.com> wrote:
>
>         Hi I am trying to make an game of Connect Five using Golang, I have 
> already made an player versus player mode so I am making the player versus 
> computer mode.

I think what you are looking for is adversarial graph search, min/max
with alpha/beta pruning

It's not (strictly speaking) Go specific, and a basic explanation can
be found at https://www.cs.cornell.edu/courses/cs312/2002sp/lectures/rec21.htm

You'll need to create a graph in memory with each node being a state
of the board, and each edge being a legal move out of the node into
another state. You'll also need to decide what constitutes a good move
(so you can award a 'strength' to each state, in one players favour or
the others) and finally you'll need to determine how many moves into
the future your application will search for it's optimal move. The
better your strength statistic is at determining optimal board states,
and the further into the future your graph will look, the better your
'AI' will be. But be aware that the limitations of time and memory
will constrain how far into the future you can look.

> At first I attempted to use if functions that detect when they need to block 
> the player but it can't win without placing blocks for itself. Also another 
> problem is that the computer have a chance on placing on the player's block. 
> So I need some help, I know you are all wonderful coders.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to