Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Computer Forums > Software Programming
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Software Programming Software programming talk, ask questions about computer software programming or help others

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-12-2007, 9:40 PM   #1
Jonathan L.
 
Jonathan L.'s Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Connect 4 AI?

I am making a connect4 clone to learn some programming.

How would I evaluate a certain position, and can I compare 7 such
evaluations to find the best move for the computer to make?

TIA
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 06-12-2007, 9:40 PM   #2
Malcolm
 
Malcolm's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Connect 4 AI?


"Jonathan L." <jl@hotmail.com> wrote in message
>
> I am making a connect4 clone to learn some programming.
>
> How would I evaluate a certain position, and can I compare 7 such
> evaluations to find the best move for the computer to make?
>

You've got to know something about the game strategy. Obviously, a position
where you connect 4 scores 100, whilst a position where the opponent
connects 4 scores 0.
You might give a position where you have 2 threes (and thus will inevitably
win next round) a score of 99, unless of course the opponent also has a
three.

I don't know enough about the game to tell you how to evaluate a more normal
position, such as when opponent is forced on the next move because you have
a three, or when you have several lines of two which could develop into
fours. However the basic principle is that you score each position, and
create a tree as deep as possible of each legal move. You then play the move
that gives the best branch.
Since the number of moves is large, you won't have a particularly strong
program unless you prune the tree - avoid examining no-hoper moves. This is
quite a difficult thing to do, and of course it depends on the evaluation
function being able to distinguish between no-hoper moves and a move which
temporarily looks weak but in fact leads to a winning strategy.


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-12-2007, 9:40 PM   #3
Loren Pechtel
 
Loren Pechtel's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Connect 4 AI?

On Sun, 06 Jul 2003 18:05:25 GMT, "Jonathan L." <jl@hotmail.com>
wrote:

>I am making a connect4 clone to learn some programming.
>
>How would I evaluate a certain position, and can I compare 7 such
>evaluations to find the best move for the computer to make?


This sort of thing cries out for a search tree. At first you
don't evaluate the position, you just try all legal moves. Since
there are only 7 this doesn't do too badly. At the next level you
have 7 to evaluate for each move you did in the first level, thus a
total of 49. The third level will have 343. The fourth 2401. I
suspect you can still get good response looking at the fifth at 16807
moves. (Note that it's likely that many of these branches have
already been pruned because someone won.)
If the computer wins, score 100. If the player wins, score 0.
Only at that 5th level do you even try to evaluate the position
beyondo win/loss checking. I do not have enough experience with the
game to comment on how to evaluate it.
Note that I wouldn't hardcode the depth. First, it can be used
to adjust difficulty. (I wrote a Reversi clone some time ago--I never
beat it at it's highest search depth.) Also, you might find the 6th
level at 117649 moves is viable.
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-12-2007, 9:40 PM   #4
Mrk
 
Mrk's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Connect 4 AI?

Hello,

If you want to delve into this stuff, connect 4 has already been solved for
quite some time, see
http://connect4.iaw.on.ca/ and download the paper by Victor Allis. If I
recall his classes correctly he'll come up with proof-number search sooner
or later.

HTH
Mrk


"Jonathan L." <jl@hotmail.com> wrote in message
news:Xns93B070D171E65pdopdo@204.127.199.17...
> I am making a connect4 clone to learn some programming.
>
> How would I evaluate a certain position, and can I compare 7 such
> evaluations to find the best move for the computer to make?
>
> TIA



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags:




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect two computers up? Stickster Computer Networking and Servers 12 01-13-2008 2:55 PM
Mysql Unable to Connect Error Andrew Kenna Database 0 06-10-2007 12:22 AM
ODBC - connect ACESS-MySQL Piet Database 0 06-10-2007 12:21 AM
how to connect to mysql from another computer? chris Database 1 05-31-2007 8:48 PM
how to connect to a remote computer? chris Database 0 05-31-2007 8:48 PM


Featured Websites




All times are GMT +1. The time now is 12:51 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98