04-03-2003, 03:08 PM
nah, qb's random number generator is rubbish. I'll skip over the fact that you can't ever generate truely random numbers, but there are better techniques. Anyway, here's a piece of code I wrote that kinda matches the quality of QB's:
Seed dw ?
MulVal dw 7361h ; Some prime number
rand proc
mov ax, Seed
mov dx, MulVal
mul dx
inc ax
mov Seed, ax
ret
rand endp
So you can imagine why it's so crap..
As far as this challenge goes..umm..I think you're a wee bit inexerienced to be placing coherent challenges
Seed dw ?
MulVal dw 7361h ; Some prime number
rand proc
mov ax, Seed
mov dx, MulVal
mul dx
inc ax
mov Seed, ax
ret
rand endp
So you can imagine why it's so crap..
As far as this challenge goes..umm..I think you're a wee bit inexerienced to be placing coherent challenges