A Chess forum. ChessBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ChessBanter forum » Chess Newsgroups » rec.games.chess.computer (Computer Chess)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Please, help me!



 
 
Thread Tools Display Modes
  #1  
Old August 29th 03, 12:33 AM
Jarek
external usenet poster
 
Posts: n/a
Default Please, help me!

Hi!

I wrote a simple Checkers program (I know it's not chess, but I believe you
can help me anyway) and I wish to improve it. I've found a
webpage(http://www.seanet.com/~brucemo/topics/hashing.htm) about
transposition table, but I don't understand few things, especially this:
'The hash array is indexed via a ZobristKey. You take the key for the
position, modulo it by the number of elements in your table, and that's the
hash element that corresponds to this position.' - why is it modulo by the
number of elements in table? Is it correct?

I'm writing in Delphi, and I managed to rewrite the code from this page in
Pascal, but I think it doesn't work well.

Thanks in advance,

Jarek


  #2  
Old August 29th 03, 05:33 AM
PJ DiSanti
external usenet poster
 
Posts: n/a
Default Please, help me!

"(I know it's not chess, but I believe you
can help me anyway)"

Restructure your beliefs.

PJ

--


"I think that gay marriage is something that should be between a man and a
woman." - Arnold Schwarzenegger

"Nothing can confound
A wise man more than laughter from a dunce."
- Lord Byron

"There is no subject so old that something new cannot be said about it." -
Fyodor Mikhailovich Dostoyevsky





"Jarek" wrote in message
...
Hi!

I wrote a simple Checkers program (I know it's not chess, but I believe

you
can help me anyway) and I wish to improve it. I've found a
webpage(http://www.seanet.com/~brucemo/topics/hashing.htm) about
transposition table, but I don't understand few things, especially this:
'The hash array is indexed via a ZobristKey. You take the key for the
position, modulo it by the number of elements in your table, and that's

the
hash element that corresponds to this position.' - why is it modulo by the
number of elements in table? Is it correct?

I'm writing in Delphi, and I managed to rewrite the code from this page in
Pascal, but I think it doesn't work well.

Thanks in advance,

Jarek




  #3  
Old August 29th 03, 07:23 AM
Delphi
external usenet poster
 
Posts: n/a
Default Please, help me!


"Jarek" schrieb im Newsbeitrag
...
Hi!

I wrote a simple Checkers program (I know it's not chess, but I believe

you
can help me anyway) and I wish to improve it. I've found a
webpage(http://www.seanet.com/~brucemo/topics/hashing.htm) about
transposition table, but I don't understand few things, especially this:
'The hash array is indexed via a ZobristKey. You take the key for the
position, modulo it by the number of elements in your table, and that's

the
hash element that corresponds to this position.' - why is it modulo by the
number of elements in table? Is it correct?

I'm writing in Delphi, and I managed to rewrite the code from this page in
Pascal, but I think it doesn't work well.

Thanks in advance,

Jarek




Because when writing a value to or getting a value from the table,
your index has to be within the range (I.E. the table size).
As hashing works with having a hash key and that key is usually
much bigger than the table size (both measured in bits), so somehow
you have to get an index from the key. Modulo is a simple solution for that.
But as with the above _many_ different keys will be mapped to the same
index, you must assure that the received entry is really for your original
key
by comparing the key stored there with your original one. Maybe this
could be a source of error in your case.
BTW, concerning simple uses of TT, I see _no_ big difference between chess
and checkers.

-delphi-


 




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
Forum Jump


All times are GMT +1. The time now is 02:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.Content Relevant URLs by vBSEO 2.4.0
Copyright 2004-2017 ChessBanter.
The comments are property of their posters.