now I am trying to generate a number between 3000 and 7000. I tried the diving trick but I do not think it lets you divide by fractions. IS there any other way?
RANDOM result
result = result // 4001
result = result + 3000
This works because // returns a value from 0 to the divisor minus one. The span between the two values is 4000. Your desired minimum value is 3000, hence gets added to the result of the modulus operation.
Comments
DO
· RANDOM tempByte
UNTIL temp <= 200
Or you could scale the value using WORD variables
RANDOM tempWord
tempWord = tempWord / 327
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
This works because // returns a value from 0 to the divisor minus one. The span between the two values is 4000. Your desired minimum value is 3000, hence gets added to the result of the modulus operation.