It appears you have not yet registered with our community. To register please click here...


Javascript: Prime or not

This is a discussion on Javascript: Prime or not within the JavaScript and Java forums. Topic: This script is a slightly modified version of "Unique Random Numbers". In this script it becomes easier to ...


Reply
 
Postbit Seperator LinkBack Thread Tools Postbit Seperator Search this Thread Postbit Seperator Display Modes
Old 10-31-2007, 10:01 AM   #1 (permalink)
 
Status: Junior Member
Join Date: Oct 2007
Posts: 8
Trader Rating: (0)
gehher is on a distinguished road
TD$: 90.00
Donate
Smile Javascript: Prime or not
This script is a slightly modified version of "Unique Random Numbers". In this script it becomes easier to implement more than one instances of "Picking Unique Random Numbers".

This JavaScript picks up a number of unique random elements from an array.
For example; if you have an array myArray consisting of 10 elements and want to pick 5 unique random elements. Suppose initially myArray[3] is picked randomly, then myArray[3] should not be picked again.
gehher is offline   Reply With Quote
Old 06-07-2008, 01:10 PM   #2 (permalink)
 
Status: Junior Member
Join Date: Jun 2008
Posts: 24
Trader Rating: (0)
kickass is on a distinguished road
TD$: 165.00
Donate
Default Re: Javascript: Prime or not
Create a variable you want to test.
Create a simple While loop where you test an increment variable (i) against your number divided by 2.
kickass is offline   Reply With Quote
Old 10-14-2008, 01:04 AM   #3 (permalink)
 
Status: Junior Member
Join Date: Oct 2008
Posts: 10
Trader Rating: (0)
Shawn33 is on a distinguished road
TD$: 75.00
Donate
Default Re: Javascript: Prime or not
I think there's a premade javascript code already, if you search on the web you should be able to find it. There's also the code for other simple games like tic tac toe and a few card games. It's amazing how powerful JS can be
Shawn33 is offline   Reply With Quote
Old 11-12-2008, 06:59 AM   #4 (permalink)
 
Status: Junior Member
Join Date: Jul 2008
Posts: 8
Trader Rating: (0)
ash05 is on a distinguished road
TD$: 55.00
Donate
Default Re: Javascript: Prime or not
Create a variable you want to test.

Condos for Sale, Buy a Condo, Condo, Condominium
ash05 is offline   Reply With Quote
Table Bottom LeftTable BottomTable Bottom Right
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




Home | Site Map | Contact | Archive | Top

 

Copyright © 2007 - 2010 iTalkWebs Network

Search Engine Optimization by vBSEO 3.1.0