Chip, 75 + 17 = 92 bytes
+17 bytes for args
-g0i -w -mq -c20
Try it online! Try adding
-vv to the args list to see the values on the queue as it runs, in the debug output.
Not the most straightforward solution... The strategy here is like this:
- fill a queue with the numbers
- pop the head of the queue, call this
- generate a random number
- if not
x back onto the queue
- jump to step 2 until all ten numbers have been printed
This strategy ensures that all permutations are possible, however the permutations are not evenly distributed. Also, it is theoretically possible to never finish printing.
This could potentially be slightly smaller if I generate a single random bit (
1) instead of two (
3), but it would have a more extreme effect on the distribution. My initial attempt, however, didn't actually save many bytes.
If there is interest, I will endeavor to explain further the actual implementation details.