Re: A83: Random Numbers


[Prev][Next][Index][Thread]

Re: A83: Random Numbers




since _Random creates ANY number between 0 and 1 (.3453435 for example) you
would have to do like this:
ld a,100
call _setxxop2
call _random
call _Fpmult
call _Int
call _Plus1  (without this you get a number between 0 and 99 I think)
ld a,65
call _setxxop2
call _cpop1op2

hope this helps,
-Dan

In a message dated 97-12-12 13:12:51 EST, you write:

<< I am having a hard time using random numbers, I can generate them, and 
 move them to op1, but how can I use that to compare it to a set value, 
 say like 65, if I want the rand value to range from 1 to 100?
 
 Here is what I got so far:
 
 call	_random
 ld	a,100
 call	_setxxop2
 call	_fpmult
 ld	a,65
 call	_setxxop2
 call	_cpop1op2
 
 now what? How do I test the cpop1op2, and am I generating the random number
 right?
 
 
 Rob
  >>