What does the description of the scramble function on page 12 in Seasoned Schemer mean?

function description:
The function scramble takes a non-empty tup in which no number is greater than its own index, and returns a tup of the same lenght. Each number is the argument is treated as a backward index from its own position to a point earlier in the tup. The result at each position is found by counting backward from the current position according to this index.

What"s the value of (scramble tup) where tup is (1 1 1 3 4 2 1 1 9 2)

Answer: (1 1 1 4 1 1 1 9)

Jun.15,2021
Menu