Josselin wrote: / ... > and at the same time trying to understand how to USE srand()and rand(), > my standard Ruby manual is clearly written but there is no example for > this function. > I googled a lot but without any success regarding examples... > my first thought was: srand() is useful in setting a limit to the > generator.... used by rand() so it could have been a clue to solve my > problem... All except you haven't yet said what the problem is. We could solve a stated problem, easily. srand() sets a particular starting point for a pseudorandom sequence. If you use srand() and supply a fixed argument, you will get the same pseudorandom sequence on each run of your program: ------------------------------------ #!/usr/bin/ruby -w 4.times do srand(1) 10.times do print "#{rand(16)} " end puts end ------------------------------------ Notice about this program that it puts out the same sequence every time. Now comment out the "srand(1)" line and see the difference. -- Paul Lutus http://www.arachnoid.com