Version 2 of Dartmouth BASIC changed the dimensions of vectors (arrays) from one-based to zero-based. This was kept from there on and inherited by most other BASIC, some later offering an OPTION BASE to select what's preffered.
The Dartmouth BASIC V4 describes this (indirect) with the DIM command in section 1.7.8 on p. 37:
1.7.8 DIM
Whenever we want to enter a list or a table with a
subscript greater than 10, we must use a DIM statement
to inform the computer to save us sufficient room for
the list or the table.
Examples: 20 DIM H(35)
35 DIM Q(5,25)
The first would enable us to enter a list of 35 items
(or 36 if we use H(0)), and the latter a table 5 x 25,
or by using row 0 and column 0 we get a 6 x 26 table.
Highlighting is mine (*1).
The same way Section 1.4, Lists and Tables (as they call arrays) starting on page 20, implicit talks about elements of numbered as 0..n. For example on p.23 a sample program without using DIM is explained as:
This sample program did not need a dimension statement,
since the computer automatically saves enough space to allow
all subscripts to run from 0 to 10.
This makes it pretty clear that the default base for indices is zero.
This is further enhanced by the way MATrix operations are described in Section 2.6. On page 54 the V4 manual states:
... However,
the user has to be careful to keep (and to understand!) the conventions
"built into" the language. We will discuss, below, the
individual MAT statements.
The following convention has been adopted for MAT: while
every vector has a component 0, and every matrix has a row 0 and
a column 0, the MAT instructions ignore these. Thus if in a MAT
instruction we have a matrix of dimension M-by-N, the rows are
numbered 1, 2,...,M, and the columns 1, 2,...,N.
At that point it might be helpful to keep in mind that the MAT instructions were originally (in V2) a set of external subroutines, following their own logic.
This isn't any new behaviour, as V2 states on p.39
BASIC provides that each list has a subscript running from 0 to 10,
inclusive. Each subscript in a table may run from 0 to 10. If the user
desires to have larger lists or tables, he may use a DIM statement in his
program. For example,
10 DIM A(17)
indicates to the computer that the subscript of the list A runs from 0 to
17, inclusive; ...
But... Dartmouth BASIC also generally starts with array index 1,
Only true for the initial Version. Already the second one (CARDBASIC) changed that to zero-based.
like most BASICs.
'most' is quite debatable, as for example all MS default to zero, which is a quite large user base. Same goes for independent microprocessor developments like BBC-BASIC, Sinclair BASIC, Locomotive BASIC (*2) or even way before that for Olivetti P6060 BASIC.
Normally you should have to use OPTION BASE 0 to do this, which this code does not, and I can't find that option in the v4 manual anywhere.
OPTION BASE is a way later addition
Moreover, other examples looping over arrays invariably start at 1, for instance, page 57, while others suggest it starts at 0, like page 21.
Examples are to show some point, the one on p.57 is about MATrix operations, which inherently started at one (*3,4).
All the online emulators emulate earlier versions only, so I have no easy way to test this.
All versions except the initial should have arrays starting at zero. So any emulation of CARDBASIC or later should show exactly this behaviour.
*1 - The last part is especially interesting, as they seem to call the 0th element explicit 'row and column' as if they are intended for labling or summation.
*2 - I find int again and again impressive that the English computer industry came up with so many different - and successful - BASIC implementations.
*3 - Since both, zero-based indices and MAT statements, were introduced with CARDBASIC, I can't help to see index 0 for either dimension als intended for label or summation purpose (see *1).
*4 - Beloved Atari-BASIC shows a similar but even more challenging behaviour. Here DIMensioning a numerical arrays have its first element at index 0, but string-"arrays" at 1. So while in Dartmouth V4 the 0th element of a matrix can be addressed, doing so with a string in Atari BASIC will result in a bad subscript :))