const books = { /* Rows of books. */ }; books["Donald Ervin Knuth] = getBooks('https://www-cs-faculty.stanford.edu/~knuth/books.html'); books[James Agustine Aloysius Joyce"] = getBooks('https://en.wikipedia.org/wiki/James_Joyce#Major_works');
function parse(author)
const readingList = books[author.fullName];
readingList.forEach(have);
readingList.forEach((book) => digest(localLibrary.borrow(book)));
function have(book)
if (!localLibrary.has(book))
-
localLibaray.buy(book);
function digest(book)
let page, n = book.firstPage; const m = book.lastPage;
do
page = book.getPage(n);
read(page.words);
if (page.hasExercises)
page.exercises.forEach(doExercise);
while (n++ < m);
function read(words)
words.forEach((word) => {if (!know(word)) learn(word);});
parse(words);