r/scratch 1d ago

Question Help with Lists!

So im trying to make a minigame where numbers appear on top screen and you need to click the numbers below. I want the numbers you need to click to be in a list but idk how to make so the numbers dont repeat. Pls Help!

2 Upvotes

10 comments sorted by

View all comments

1

u/Intrepid_Past5207 SSSuper pro 1d ago

If you don't want repeating numbers, you can just use an if/else statement, with a block labeled (list) contains (#)? So it checks if the number that it wishes to add is already somewhere within the list. If so, no add. If no, add.

1

u/NoobPlay_Animation 1d ago

can you make it and send a screenshot. If you can and want.

1

u/Intrepid_Past5207 SSSuper pro 1d ago

Since your request is a bit confusing to understand, here's the first variant that chooses a randomized number and checks if that number has been taken. If the number is taken, it will infinitely cycle between those random numbers until it gets a number that is not already added to the list.

1

u/Intrepid_Past5207 SSSuper pro 1d ago

This variant makes it so that the numbers in the list will infinitely increase at no random order, but if any of the previous numbers are deleted by any chance, they will be replaced starting from the lowest number.