From: Dark Ambient Date: 2006-07-28T03:51:18+09:00 Subject: Re: Learn to Program - Solutions? Nate, Is this what your referring too ? toc = ['Table of Contents', 'Chapter 1', 'Getting Started', 'page 1', 'Chapter 2', 'Numbers', 'page 9', 'Chapter 3', 'Letter', 'page 13'] line_width = 30 puts( toc[0].center(line_width*3)) puts puts( toc[1].ljust(line_width) + toc[2].ljust(line_width) + toc[3].ljust(line_width)) puts( toc[4].ljust(line_width) + toc[5].ljust(line_width) + toc[6].ljust(line_width)) puts( toc[7].ljust(line_width) + toc[8].ljust(line_width) + toc[9].ljust(line_width)) Hope that helps Stuart On 7/27/06, Nate Turnage wrote: > On 7/27/06, James Edward Gray II wrote: > Refresh my memory on what that exercise is and I'm happy to give a > > hint or two. > > "Rewrite your table of contents program on page 35. Start the > program with an array holding all of the information for your table > of contents (chapter names, page numbers, etc.). Then print out > the information from the array in a beautifully formatted table of > contents." > > The chapter is about array methods. For each chapter there is a > chapter number, a chapter title, and a page number. I understand how > the info for each chapter > can live in an array, but I don't understand how all of the data for > all of the chapters lives in a single array that holds all that data. > Thanks in advance. > > pixelNate > >