I want to look at every n-th elements in an array. In C++, I\'d do this:
for(int x = 0; x
Just use step() method from Range class which returns an enumerator
(1..10).step(2) {|x| puts x}