Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Random number code help.

    I need help with a code that will generate a random number or integer (from 1-9). Does anybody know of a short random generator without having to import anything? thank you.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,101
    Thanks
    38
    Thanked 498 Times in 492 Posts
    var random_number = Math.floor(Math.random()*9)+1

  • Users who have thanked jmrker for this post:

    Lilo17x (12-08-2010)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •