![](/static/66c60d9f/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/f3a4dd5f-1257-47c8-825a-03a4ebceace3.webp)
1·
10 days agoYou are correct. Its quiet a find but I can reproduce this. I suspect the issue lies in the piece of code that tries to make sure you don’t get the same animal twice when you select a random animal. You can also follow the steps until there is only the Newt and then press the dice below it’s name. Now there are no animals.
The random selector subtracts one from the total options and adds that one back if the new number is greater or equal to the precious number. So in case of only a single option it gets 0 at random, which equals the previous index and does +1, which doesn’t exist.
There should be a failsafe that prevents this logic if there is only one animal in total 🤷♂
Did you ever find a solution? I’m on mobile, and the Pastebin formatting is a bit off, so I can’t read the compose file very well. However, I suspect the error is related to this line:
Since a colon (‘:’) is used to indicate a volume, it makes sense that the error is about a missing volume. Try wrapping the line in double quotes like this:
to see if that fixes the error.