modand n-valuesare your friends here:
to-report continue-list [ lst n ]
report n-values n [ item (? mod length lst) lst ]
end
Usage example:
observer> show continue-list [0 1] 7
observer: [0 1 0 1 0 1 0]
observer> show continue-list [0 1] 1
observer: [0]
observer> show continue-list [0 1 2 3 4] 22
observer: [0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1]
Edit: , , ! n-values n [ ... ] n, 0 n - 1 . ? ( NetLogo task). . mod. i i mod <length of original list>. , , n-values n [ item (? mod length lst) lst ] n, lst.