Seasoned Schemer一书中,第12页的scramble函数,描述是什么意思?

函数描述:
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 1 1 4 1 1 1 9)

阅读 1.9k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进