2011/10/14 Samuel Mensah <sasogeek / yahoo.com>:
> puts (toc[1,2].join(" ").ljust (line_width)) + (toc[3].rjust
> (page_column))
> puts (toc[4,5].join(" ").ljust (line_width)) + (toc[6].rjust
> (page_column))
> puts (toc[7,8].join(" ").ljust (line_width)) + (toc[9].rjust
> (page_column))
>

You are confusing two array access method in the last three lines.

arr[a, b] (with a comma - two arguments) means "b elements, starting
from index a".

arr[a..b] (with two dots - a range) means "elements, starting from
index a, ending at index b, inclusive" (with three commas, it'd be
"...exclusive").

Refer to the docs for details.

-- Matma Rex