#!/usr/local/bin/ruby p [0, 1, 2, 3, 4].select.with_index {|a, i| i % 2 == 0}