Permutations: Difference between revisions

m
m (syntax highlighting fixup automation)
m (→‎An Uncommon Ordering: corrected typo)
Line 7,872:
by stuffing the 0 into each of the 4 possible positions that it could go.
 
The code start with a nest of all the permutations of 0 items <code>[ [ ] ]</code>, and each time though the outer <code>times</code> loop (i.e. 4 times in the example) it takes each of the permutations generated so far (this is the <code>witheach</code> loop) and applies the central idea descrieddescribed above (that is the inner <code>times</code> loop.)
 
'''Some aids to reading the code.'''
1,462

edits