(let ((walk (random-walk 100 400)))
(loop
for y in walk
for x below (length walk)
collect (cons x y)))
'((400 . 200)))
(loop repeat 3
collect (random 256))))))
I realized that we want y to be the values from the random-walk function, but x should be each point along the x axis from 0 to 400. Then we cons the x and y to get the points list.
With the default code from the book, sbcl was generating a list of points from the list returned by (random-walk 100 400), but it wasn't moving across the list in the expected manner. Each x and y were the same, so you would have a points list like '((100 . 100) (99 . 99) (98 . 98)(99 . 99)) etc.
Then I tried makeing x be items in (random-walk 100 400) and y be (cdr (random-walk 400)), but I didn't want to call random-walk twice and get different lists, so I used let to create the local variable walk and: loop for x in walk for y in (cdr walk). This generated a points list with different numbers, but the polygon cam out to be a trianlge. This is because the points list was like so '((100 . 99) (99 . 98) (98 . 99) (99 . 98)) etc. Still not right.
Rethinking what the points list should be I cam up with the solution of having each x be a number between 0 and 400 and y be the value of the symbol at the position x in (random-walk 100 400). I could probably go back and remove the local variable now. Hope this helps others.