ch04: Possible error in output example of "Building Versatility Into Iterating a Playlist"
vsemozhetbyt opened this issue · 1 comments
vsemozhetbyt commented
See last code examples in this section.
If I get this right, we get a sequence from the shuffleSongs() just once and iterate this sequence every time in the same order. So we cannot have different order inside each loop like:
// <- ['a', 'b', 'b', 'a', 'a', 'b']
Only these varians are possible:
// <- ['a', 'b', 'a', 'b', 'a', 'b']
// <- ['b', 'a', 'b', 'a', 'b', 'a']
bevacqua commented
This is correct to maintain consistency across runs. If you wanted different orders every time, you can keep calling playlist()