Ludii Forum
Index out of bounds and frozen game - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13)
+--- Forum: About the Ludii Grammar (https://ludii.games/forums/forumdisplay.php?fid=15)
+--- Thread: Index out of bounds and frozen game (/showthread.php?tid=498)



Index out of bounds and frozen game - Michael - 03-09-2021

I (think I) have implemented Mihaw's Lelac, but there are 2 major problems with the file:

1: The game starts with a random value between 1 and 6 at the centre cell, and every time one makes a move this changes randomly. When the initial random value is 6, I get the message "Index 6 out of bounds for length 6", and I am unable to make a move. What does this mean?

2: After about 3 moves the game freezes and I am unable to make a move. Why?

I have attached the file.


RE: Index out of bounds and frozen game - Eric Piette - 03-10-2021

Hi,

That's because you are using the local state and you reached a value (here 6) which is greater than the default maximum possible for this data in this game in Ludii.

Since a recent release, you can modify that value in adding "maxState:<Integer>" to any of the piece in the game.
So for your game:
(piece "Disc" Neutral maxState:6)

I did it and that solves both problems.

However, in this .lud, you did not add the info to the metadata. Do you want that one to be included in Ludii? If yes, can you submit it again with them? Thanks!

Regards,
Eric


RE: Index out of bounds and frozen game - Michael - 03-10-2021

Thank you so much!
Yes, I will submit it with metadata later if Mihaw wants to. I haven't had the opportunity to test it properly because of this issue.