Hashed repetition table

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Hashed repetition table

Post by Dann Corbit »

flok wrote:What about an std::unordered_set<uint64_t> where you keep track of the hashes?
An unordered_set is O(1) afaik.
std::unordered_set<type>
is just a hash table, like any other hash table.

A hash table is O(1) unless you don't make it big enough, or unless you have a zillion collisions.

In either case, it goes into the crapper.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Hashed repetition table

Post by hgm »

Cardoso wrote:Agreed, just let's hope those pathological cases aren't the norm.
Anyway while there are still pawn moves that possibility is low, and when there are few pawns left on the board the game is usually decided.
But then again in some near endgame or endgame that can happen.
In Crazyhouse (or Shogi) it is always the case, as even Pawn moves are not irreversible. The Pawn can be traded, and dropped back to the square it originally came from.