Talk:Generate random numbers without repeating a value: Difference between revisions

two other omissions
(→‎Why not use shuffle: Further comment.)
(two other omissions)
 
Line 8:
 
::: Well, if that's what the author intended, the task description seems a very long-winded way of saying: "create a list of the first 20 positive integers and randomly shuffle them". Anyway, as that seems to be the consensus view, I've added alternative implementations to my own efforts. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 08:53, 26 August 2021 (UTC)
 
: Of course the other thing not specified in the task is what happens if you call the function 21 times, or after generating some permute of 1..20 (that is, if calling individually) how you would then start on a permute of say 1..10, or even interleave them. Using shuffle sidesteps all such issues. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 01:30, 27 August 2021 (UTC)
7,794

edits