Using a prior PV move even though it results in a draw

Discussion of chess software programming and technical issues.

Moderator: Ras

KhepriChess
Posts: 93
Joined: Sun Aug 08, 2021 9:14 pm
Full name: Kurt Peters

Re: Using a prior PV move even though it results in a draw

Post by KhepriChess »

Ronald wrote: Thu Feb 09, 2023 8:03 pm So, if I understand you correctly "this.PositionHistory[this.PositionHistory.length] = this.Position.Hash;", is the same as something like "this.PositionHistory[this.PositionHistory.length++] = this.Position.Hash" in C.
I think that's right. C requires you to initialize the array with a fixed length, right, so if you try to write to an index beyond that length (without increasing the length beforehand) it'll throw a fault/exception? With Javascript, if you try to write to an index that's technically "out of bounds" from the array's current length, it just automatically increases the length of the array to accommodate.
Puffin: Github
KhepriChess: Github