Hello guys, I have this problem here, I found only 1 answer to this question but it is outdated (2016). So If you can help I would be thankful. This is the situation: I have while loop which is going until main variable is 0, under it there is random in range depending on difficulty and then there are tasks which it is going to do depending on the random number, each task ends with subtracting 1 from main loop variable so it loops again. Here is the problem: I don’t want the random to choose the same task more than once so I want the random in range to not repeat number it already chosen.
I can do variable for each task so when it’s done it will loop the random again but it would be ineffective because, more tasks done the more it would take to loop randomly between finished ones and unfinished ones.
So I was wondering if there is way to do it that if task is completed it would not be included in the random in range, so it wouldn’t choose the same number again.