riffle function
A list with a value put between its elements.
How to write it
riffle(list, x)
- list
- The list. Takes a list.
- x
- The value to put between. Takes an expression.
Examples
riffle([1, 2, 3], 0)In the solver,
Open in the solverriffle([1, 2, 3], 0)gives[1, 0, 2, 0, 3].
Related functions
- rotate_left
A list with its elements moved to the left, the first ones going to the end.
- reverse
A list in reverse order.
- rotate_right
A list with its elements moved to the right, the last ones going to the front.
- rest
A list without its first element.
- select
The elements of a list for which a test holds.
- replace_part
A list with the part at a position replaced; write position -> value.