I just browsed through chapter 10 of Leo Brodie's Starting Forth
(available on the web) and found this:
Handy Hint:
A Random Number Generator
This simple random number generator can be useful for games, although
for more sophisticated applications such as simulations, better
versions are ava
\ simple RND generator u2 = 0..u1-1) )
variable rnd here rnd !
: (random) rnd @ 31421 * 6927 + dup rnd ! ;
: nip swap drop ;
: random ( u1 -- u2 ) (random) um* nip ;
examples:
adc-pwm-demo.frt
- PŮVODNÍ ZPRÁVA -
Od: "Jan Kromhout"
Komu: amforth-devel@lists.sourceforge.net
Předmět:
Hello,
I need a random number generator in AMForth.
(It may be a generator thats generate 0..1023 as an integer)
Has someone make this one for AMForth?
Regards,
Jan Kromhout
Hellevoetsluis-NL
--
Live Security Virtual C
Hello all.
I have now for a couple of days AMForth on my arduino.
I like it very well.
Today I started to look what to have done to implement the analog write to a
special port (PWM)
When I look to the source in de arduino directory it is very complicate to
implement.
It is very hard for me as a