Shop OBEX P1 Docs P2 Docs Learn Events
Random number generator — Parallax Forums

Random number generator

ArchiverArchiver Posts: 46,084
edited 2002-11-25 13:57 in General Discussion
Hi all, I need to generate a random betwwen 1 and 7 can anyone help
me with the coding please? how do I make sure the number generated
is between 1 and 7?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-25 13:57
    Take a look in the manual at the RANDOM statement and the //
    (modulus) operator. That and a little simple arithmetic should get
    you there.

    Regards,

    Steve

    On 24 Nov 02 at 21:31, konpen wrote:

    > Hi all, I need to generate a random betwwen 1 and 7 can anyone help
    > me with the coding please? how do I make sure the number generated
    > is between 1 and 7?
Sign In or Register to comment.