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

→‎Why not use shuffle: Further comment.
(→‎Why not use shuffle: Further comment.)
Line 6:
 
::There are times you have to read between the lines: in this case what was asked for is almost certainly not what was actually wanted. I placed more emphasis on the "Try your best not to make the process take too long at runtime." part, which to me means ''not'' generating/testing/discarding potentially thousands of numbers, and instinctively used shuffle() as you suggest, more in line with the Julia, Raku, and REXX entries. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 03:06, 26 August 2021 (UTC)
 
::: 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)
9,476

edits