Open HarryCordewener opened 1 year ago
Not just for grid-view, but in general, the proper randomization algorithm is as follows: Have an array that contains paths of all files to be shown. Each time an item is randomly chosen from the array, swap it with the last element, and pop(). (for efficiency, o.w. it'd be O(n) to remove it from the middle of the array, as you're unfortunately doing in here) Once the array is empty (or near empty in case of grid-view), refill it with all the paths again.
I would love if there was a way if I showed the same scene twice in a Grid, or even across two scenes with a subset of images that overlap, if I could stop a Grid from showing the same picture more than times in the same grid view.