Error - " Attempt to get item number 17 of a list of length 16"

I want to create an algorithm which shows a random number (from 1 to 32) of matches on the screen but I keep getting this message.

Replace “31” with length of list > zapalky ?

This way on each iteration the length of list zapalky should match the number of items left
(you may have to add a “-1” to length of list ?)

Good idea.

I have tried it but I keep the same error

Maybe you don’t get the new list on each iteration.

Consider generating the random list of 1-31/32 and put that in a variable before starting the routine. Then you can iterate through each value in the list.

It doesn’t work either :confused:

Ive figured it out :slight_smile:

Please provide your solution :slight_smile:

This is how I would do it: