Any comments on the relative level of ignorance for this is welcome
(be gentle, please) but this seems to me to be usable and
understandable even to relative beginnners:
##################################
a=20
b=20
c=10
d=0
e=40
f=10
a_range = 1..a
b_range = (a+1)..(b+a)
c_range = (a+b+1)..(a+b+c)
d_range = (a+b+c+1)..(a+b+c+d)
e_range = (a+b+c+d+1)..(a+b+c+d+e)
f_range = (a+b+c+d+e+1)..(a+b+c+d+e+f)
puts a_range
puts b_range
puts c_range
puts d_range
puts e_range
puts f_range
10.times do
x = rand(100)
puts x
if a_range.include?(x)
puts "call method a"
end
if b_range.include?(x)
puts "call method b"
end
if c_range.include?(x)
puts "call method c"
end
if d_range.include?(x)
puts "call method d"
end
if e_range.include?(x)
puts "call method e"
end
if f_range.include?(x)
puts "call method f"
end
end
##############################
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general