Re: Random numbers

2000-08-27 Thread Laurens Holst
Below I pasted an assembly source of a random number generator that uses an algorithm based on multiplication with a prime number and XOR-ing with a fixed mask. In its current form, it produces numbers in the range 0..27, but you can easily change that. You have to know that the

Re: Random numbers

2000-08-27 Thread Alex Wulms
] At 21:06 26-8-00 +0200, you wrote: ] Albert Beevendorp wrote: ] ld a,r ] ld b,a ] ld a,r ] xor b ] ld b,a ] ld a,r ] xor b ] ] is a better way to randomize and repeating this more should improve it. ] I don't think so, because the time it takes to repeat it is constant so R ]

Re: Random numbers

2000-08-27 Thread Ricardo Bittencourt
; Fast random number generator using the same method ; as the CDMA used in celullar telephones SEED: DW 0 ; init random seed INIT_SEED:

Random numbers

2000-08-26 Thread Arjan Bakker
I've been working on a game for some time now (Bomberman, MAYBE FutureDisk will show a demo of it on the Bussum-fair) but I'm having some troubles with generating random numbers. I'm now using the refresh register which I add to the previous offset in a look-up table, but it isn't random enough

Re: Random numbers

2000-08-26 Thread Maarten ter Huurne
On Sat, 26 Aug 2000, you wrote: I've been working on a game for some time now (Bomberman, MAYBE FutureDisk will show a demo of it on the Bussum-fair) but I'm having some troubles with generating random numbers. I'm now using the refresh register which I add to the previous offset in a look-up

Re: Random numbers

2000-08-26 Thread Patriek Lesparre
Arjan Bakker wrote: I'm having some troubles with generating random numbers. I'm now using the refresh register which I add to the previous offset in a look-up table, but it isn't random enough for me. In stead of adding 'R' to the previous offset, try adding the joystick inputs. Or rotate

Re: Random numbers

2000-08-26 Thread Albert Beevendorp
At 19:46 26-8-00 +0200, you wrote: I've been working on a game for some time now (Bomberman, MAYBE FutureDisk will show a demo of it on the Bussum-fair) but I'm having some troubles with generating random numbers. I'm now using the refresh register which I add to the previous offset in a look-up

Re: Random numbers

2000-08-26 Thread Albert Beevendorp
At 20:24 26-8-00 +0200, you wrote: At 19:46 26-8-00 +0200, you wrote: I've been working on a game for some time now (Bomberman, MAYBE FutureDisk will show a demo of it on the Bussum-fair) but I'm having some troubles with generating random numbers. I'm now using the refresh register which I add

Re: Random numbers

2000-08-26 Thread Arjan Bakker
Below I pasted an assembly source of a random number generator that uses an algorithm based on multiplication with a prime number and XOR-ing with a fixed mask. In its current form, it produces numbers in the range 0..27, but you can easily change that. You have to know that the middle

Re: Random numbers

2000-08-26 Thread Arjan Bakker
In stead of adding 'R' to the previous offset, try adding the joystick inputs. Or rotate/shift the offset every button-press. User input is often the best way of creating random numbers :) A bit of XOR'ing here and there is not a bad idea either. That sounds like a good idea too. I'll

Re: Random numbers

2000-08-26 Thread Maarten ter Huurne
On Sat, 26 Aug 2000, you wrote: In its current form, it produces numbers in the range 0..27, but you can easily change that. You have to know that the middle bits of the seed are the most "random", so use those for the result. Thanks Maarten. And yes, I knew that the middle bits of R

Re: Random numbers

2000-08-26 Thread Arjan Bakker
Albert Beevendorp wrote: ld a,r ld b,a ld a,r xor b ld b,a ld a,r xor b is a better way to randomize and repeating this more should improve it. I don't think so, because the time it takes to repeat it is constant so R will be increased with the same number all the time. Greetz. Arjan