1 2 3 4 5 6 7 8 9 10 11 12
def op(acc x) if mod(x 2) +(acc x) else acc end end # add odd numbers from 0 to 1000 def main() display(fold(0 op ..(0 1000))) end