1 #from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
7 # create a list of integers (Li1) from 1 to SIZE
9 # copy the list to li2 (not by individual items)
11 # remove each individual item from left side of li2 and
12 # append to right side of li3 (preserving order)
14 while (not li2.empty?)
17 # li2 must now be empty
18 # remove each individual item from right side of li3 and
19 # append to right side of li2 (reversing list)
20 while (not li3.empty?)
23 # li3 must now be empty
24 # reverse li1 in place
26 # check that first item is now SIZE
27 if li1[0] != SIZE then
31 # compare li1 and li2 for equality
35 # return the length of the list