function countingoff(count, steps) {
var people = []
while (count) { people.unshift(count--)}
Array.prototype.pop = function(idx) { return this.splice(idx, 1)[0] }
var idx = 0
while (people.length) {
idx = (idx + steps - 1)%people.length
console.log("removed: #", people.pop(idx), ", left: ", people)
}
}
// example
countingoff(25, 7)