a[1..10] # elements from 1 to 10, including 10
a[1...10] # elements from 1 to 9; k...n is a half open range notation
a[3, 5] # 5 elements, starting from position 3
Arrays are still zero based, but I feel this is more a homage to for- and while- loops from older languages.
(for (i = 0; i < n; i++) is just a very nice notation, and so is while (i < n))
Ruby offers three very similar syntaxes for the same concept. Contrast that with Python's "there should be one—and preferably only one—obvious way to do it"[1] ethos.
I found it quite unintuitive too at first. My way of remembering it was to think of the distance between the endpoints. The first example is inclusive because it's closer and the endpoint is "included" whereas the second range endpoint is shunned and shoved further away and is exclusive because it's "excluded"!
I don't know anything about ruby but that seems extremely error prone to me.
EDIT: I think I know why I think it's error prone:
In all programming languages besides the core syntax of the language idioms appear among the community of coders. For instance, in C you travel through an array using something like:
for (i = 0; i < n; i++)
a[i] = ...;
Where n is the length of the array. This is an idiom so common that if for some reason in some code the length of an array is (n + 1), instead of writing for (i = 0; i <= n; i++) I'll write for (i = 0; i < (n + 1); i++).
Because the idiom is so strongly entrenched in my brain (and probably many other C coders) if I read the <= version there's a great chance I'll read it as a "<" and assume i goes from 0 to n - 1.
My point is adding several alternative "syntactic sugar" to express the same thing can end up confusing newbies because they'll have to learn the difference between all version (and recognize them) as well as experienced coders because you're more likely to mistake the meaning of an expression at a cursory glance.
Ruby doesn't nail it using ranges. Ruby nails it by implementing Array#each.
0-index versus 1-index should not be an issue at this level of programming. You shouldn't be using for-loops; you should be iterating from start to finish.
(for (i = 0; i < n; i++) is just a very nice notation, and so is while (i < n))