-->
function skipping(sequence prisoners, integer step, survivors=1)
integer n = length(prisoners), nn = n, p = 0
while n>survivors do
integer found = 0
while found<step do
p = iff(p=nn?1:p+1)
found += prisoners[p]!=-1
end while
prisoners[p] = -1
n -= 1
end while
return remove_all(-1,prisoners)
end function
--?skipping({"Joe","Jack","William","John","James"},2,1) --> {"William"}