#!/usr/bin/ruby srand 1234 print "0 <= x < 1.0: " puts rand print "0 <= x < 10 : " puts rand(10)