Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old August 28th 03, 11:33 PM
Jarek
 
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   Report Post  
Old August 29th 03, 04:33 AM
PJ DiSanti
 
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   Report Post  
Old August 29th 03, 06:23 AM
Delphi
 
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-


Reply
Thread Tools
Display Modes

Posting Rules

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



All times are GMT +1. The time now is 01:41 AM.

Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017