Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

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)=[1,0,2,0,3]\displaystyle \operatorname{riffle}(\left[ 1, 2, 3 \right], 0) = \left[ 1, 0, 2, 0, 3 \right]
    riffle([1, 2, 3], 0)

    In the solver, riffle([1, 2, 3], 0) gives [1, 0, 2, 0, 3].

    Open in the solver
  • 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.