Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
|
|
Generators |
Page: 1 | Reply |
Aug 31st 2001 | #15033 Report |
Member since: Jan 1st 1970 Posts: |
How do I make a generator that cycles through certain numbers? Kinda' like a password generator, but only cycles through certain numbers that I choose? Thanks for the help...:D |
Reply with Quote Reply |
Sep 1st 2001 | #15085 Report |
Member since: Jun 30th 2001 Posts: 447 |
What language? I assume you want JavaScript, correct?
|
Reply with Quote Reply |
Sep 1st 2001 | #15115 Report |
Member since: Jan 1st 1970 Posts: |
Correct :D
|
Reply with Quote Reply |
Sep 1st 2001 | #15132 Report |
Member since: Jun 30th 2001 Posts: 447 |
[code] // PLACE THIS CODE IN THE HEAD // The Array Function function makeArray(len) { for (var i = 0; i < len; i++) this[i] = null; this.length = len; } // This is where the array of numbers is created nums = new makeArray(4); nums[0] = 1; nums[1] = 2; nums[2] = 4; nums[3] = 7; // The random number generator. function rand(n) { seed = (0x015a4e35 * seed) % 0x7fffffff; return (seed >> 16) % n; } var now = new Date() var seed = now.getTime() % 0xffffffff // PLACE THIS CODE IN THE BODY // Where you place this is where the random number will be displayed (2 digits in length) for (var i = 0; i < 2; i++) { document.write(nums[rand(nums.length)]) } [/code] |
Reply with Quote Reply |
Sep 1st 2001 | #15134 Report |
Member since: Jan 1st 1970 Posts: |
Dude, thank you soooo much!! :D
|
Reply with Quote Reply |
Sep 2nd 2001 | #15158 Report |
Member since: Jun 30th 2001 Posts: 447 |
no prob
|
Reply with Quote Reply |
Page: 1 | Back to top |
Please login or register above to post in this forum |
© Web Media Network Limited. All rights reserved. No part of this website may be reproduced without written permission. Photoshop is a registered trademark of Adobe Inc.. TeamPhotoshop.com is not associated in any way with Adobe, nor is an offical Photoshop website. |