Non-transitive dice: Difference between revisions

Content added Content deleted
m (→‎{{header|J}}: minor cleanup)
m (→‎{{header|J}}: fix markup)
Line 378: Line 378:
}}</lang>
}}</lang>


Here, <tt>extend<tt> takes a list of die sequences and appends each possibility of a new die where the new die is not less than the last die in the sequence. So, <tt>r</tt> is all such lists of length x. We discard the cases where the last element of the list is not less than the first, rotate each dice index list into canonical order, discard duplicates, and then use these indices to select the associated dice.
Here, <tt>extend</tt> takes a list of die sequences and appends each possibility of a new die where the new die is not less than the last die in the sequence. So, <tt>r</tt> is all such lists of length x. We discard the cases where the last element of the list is not less than the first, rotate each dice index list into canonical order, discard duplicates, and then use these indices to select the associated dice.


Task examples:
Task examples: