To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 2733
2732  |  2734
Subject: 
Re: Brickgame [connect 4] algorithm
Newsgroups: 
lugnet.off-topic.geek
Date: 
Wed, 31 Jan 2001 17:28:18 GMT
Viewed: 
73 times
  
In lugnet.off-topic.geek, Dan Boger writes:
On Tue, Jan 30, 2001 at 10:05:14PM +0000, David Eaton wrote:
Anyway, That's about it... Pretty simple, actually, without digging several
ply into the game... Or re-calculating the grid at each phase... Anyone got
any suggestions? Comments? Etc? Did you actually care about this message? :)

heh, I liked it.  Never thought of trying a connect 4 game...  I did write
a tic-tac-toe that learned from experiance...

hmmm...  I'm trying to think of a way to quantify the killing play (one
that leaves you two ways to win next turn) without looking ahead...
perhaps you can say something like

if I can place a second token in a row, with clear spaces on both ends, do
that?  and put it after the "block other player" clause?

I think I'd quantify that to something along the lines of (tell me if this
sounds wrong):

A. If there exists a line of 5 or more available spaces wherein my opponent
has not taken any of them:

B - If I have 0 of these spaces (excluding the ends)
      Assign the most 'middle' spaces +1 in value (I.E. not the ends)
  - If I have 1 of these spaces (excluding the ends)
      Assign the most 'middle' spaces +3 in value (within 2 spaces of existing
      taken space
  - If I have 2 of these spaces, within a span of 3 (excluding the ends of the
    span of 5)
      Choose the most valuable of these spaces (within the span of 3,
      excluding the ends of the span of 5)

Then go back and apply the 'can the other player win in 1 move' clause, etc.

Hmm... the only tough part is finding that 'span of 5 or more' to begin
with, since it can exist on a row or across a diagonal... But otherwise a
good rule :) Once you've found it, the rest is pretty easy... I had rather
given up on trying to make trap clauses as most of the ones I had found
kinda 'cheated' and looked ahead in the game...

DaveE



Message is in Reply To:
  Re: Brickgame [connect 4] algorithm
 
(...) heh, I liked it. Never thought of trying a connect 4 game... I did write a tic-tac-toe that learned from experiance... hmmm... I'm trying to think of a way to quantify the killing play (one that leaves you two ways to win next turn) without (...) (23 years ago, 30-Jan-01, to lugnet.off-topic.geek)

5 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR