[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: computer-go: Pattern search/matching



I've done this same thing, and it matches the patterns just fine. My
problem is how do I enter the pattern (with don't care) into the hash table
or binary tree? Because "don't care" should also (at least in my mind) be
able to mean %00 (not just %01 or %10).

Because of this, when entering the original pattern (with the "don't cares")
into a hash table, the values alter the index the hash function returns.
See my problem?

Any advice is very appreciated.

Jeff


gnugo can do matching with 'dont care'. It can also do 'either X or empty'
and 'either O or empty'

The algorithm we use is : (% indicating binary)

encode blank as %00
white as %01
black as %10

Then each pattern element is tested by and-ing with one pattern and
comparing
with a second.

Test for blank, white or black by anding with %11 then comparing with
required value
white-or-blank is and with %10 then compare with 0
black-or-blank is and with %01 then compare with 0

David Denholm daved@xxxxxxxxxxxxxxxxx
Citrix Systems UK Ltd. http://www.citrix.com/
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com