\ 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" <krom1...@hotmail.com>
Komu: amforth-devel@lists.sourceforge.net
Předmět: [Amforth] Random number generator
Datum: 9.5.2012 - 21:13:42

> 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 Conference
> Exclusive live event will cover all the ways
> today's security and 
> threat landscape has changed and how IT managers
> can respond. Discussions 
> will include endpoint security, mobile security
> and the latest in malware 
> threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Amforth-devel mailing list for
> http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
> 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to