WandererXII / lishogi

☗ lishogi.org: the forever free, adless and open source shogi server forked from lichess.org ☗
https://lishogi.org
GNU Affero General Public License v3.0
265 stars 40 forks source link

Increase max number of moves in a study chapter #720

Closed olekawaii closed 6 months ago

olekawaii commented 1 year ago

Currently you can't have a line longer than 400 moves in a chapter. However, chu games can occasionally go over 400 moves.

Also moves can't be numbered higher than 501. After 500 moves, if just flips between 500 and 501. If the move number in a FEN is higher than 500 and you plug in into a chapter, it reverts back to 500

WandererXII commented 1 year ago

I will fix the 500 number, the issue is here, ig. Thanks for reporting this: https://github.com/WandererXII/scalashogi/blob/main/src/main/scala/format/forsyth/Sfen.scala#L13

The 400 limit is necessary, because the implementation is recursive and it would blow the stack. I tried rewriting it to make it all tail recursive, but decided it's not worth it. Alternative is to increase stack size, but I don't know... These large studies would be slow anyway, so I think it's better to leave it as it is.

WandererXII commented 6 months ago

The 400 move limit is still in effect, because of the recursive implementation. But the move number can now go up to 9999.