Skip to content

Instantly share code, notes, and snippets.

@carlwiedemann
Created October 23, 2014 18:03
Show Gist options
  • Save carlwiedemann/8ea54b743a51dd585209 to your computer and use it in GitHub Desktop.
Save carlwiedemann/8ea54b743a51dd585209 to your computer and use it in GitHub Desktop.
s = 0
1000.times {|i| s += i % 3 == 0 || i % 5 == 0 ? i : 0 }
puts s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment