توليد اعداد تصادفي در يك محدوده خاص
سه شنبه 5 بهمن 1389 1:43 AM
از اين فرمول:
Int (Rnd * (HighBound - LowerBound)) + LowerBound
LowerBound: حد پايين
HighBound: حد بالا
Dim LowerBound, HighBound, Area As Integer
LowerBound = InputBox("Enter Lower Bound:", "Lower Bound of Area")
HighBound = InputBox("Enter High Bound:", "High Bound of Area")
Area = HighBound - LowerBound
Print Int(Rnd * Area) + LowerBound
Area محدوده هستش.