March 28, 2019
4:55 p.m.
Tim I found myself puzzling as to *why* James's solution works. This longer explanation helped me to understand. First, generalize moving forward to moving an arbitrary number of steps, still with wrapping. ^list at: (index + move - 1 \\ size + 1 Second, realize that moving backward one step with wrapping is exactly equivalent to moving forward (size - 1) steps - because of wrapping, a move of size steps is null. Finally, substitute move = size - 1. ^list at: (index + size - 2 \\ size + 1. This can of course easily generalize to backward moves of any size. HTH Peter Kenny -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html