Fix on "Random lines" sample program

"Range ...." is now done 1 time, outside of the loop.