Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Random Numbers...

 
Post new topic   Reply to topic Printable version
 View previous topic  early version of another map editor Post :: Post PALM os lvl editor?  View next topic  
Author Message
Solid_Fire
Server Help Squatter


Age:34
Gender:Gender:Male
Joined: Dec 22 2004
Posts: 327
Location: NV. Dont stalk me..plz..
Offline

PostPosted: Fri Apr 29, 2005 9:37 pm    Post subject: Random Numbers... Reply to topic Reply with quote

Hello...im making a random number generator....just cause...no reason really. But i do have a question...

How would i make it use the first 3 digits out of 7, the beggining of a phone number? (i.e. 246, 888, 882, etc..) and the last 4 digits randomly selected. Here is the code..

Code: Show/Hide
<html>
<title>Random Number Picker v0.1</title>
<head><style type="text/css">
.a1{
position:relative;
font-family:Verdana;
font-size:20px;
color:#888888;
}
</style>

<script language="JavaScript">

/*****************************************
* Random Number Generator.(By JPS (initials))
* This notice must stay intact for use.
*****************************************/

var totalnumbers=7 //input total numbers to generate
var lowerbound=1   //input lower bound for each random number
var upperbound=9  //input upper bound for each random number

function lotto(){
B=' ';   
RandomNumbers=new Array();   
for (i = 1; i <= totalnumbers; i++)
{
RandomNumber = Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
  for (j = 1; j <= totalnumbers; j)
  {
  if (RandomNumber == RandomsNumbers[j])
    {
     RandomNumber=Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
     j=0;
    }
  j++;
  }
RandomsNumbers[i]=RandomNumber;
}
LottoNumbers=RandomNumbers.toString();
X=LottoNumbers.split(',');
for (i=0; i < X.length; i++)
{
X[i]=X[i]+' ';
if (X[i].length==2)
X[i]='0'+X[i];
}
X=X.sort();
for (i=0; i < X.length; i++)
{
OutPut=B+=X[i];
}
if (document.all)document.all.layer1.innerHTML=OutPut;
if (document.getElementById)document.getElementById("layer1").innerHTML=OutPut;
if (document.layers){
  document.layers.layer1.document.open();
  document.layers.layer1.document.write("<span style='position:absolute;top:0px;left:0px;font-family:Verdana;font-size:20px;color:#888888;text-align:center'> "+OutPut+"</span>");
  document.layers.layer1.document.close();
  }
  T=setTimeout('lotto()',20);
//window.status=OutPut;
}
function StOp(){
setTimeout('clearTimeout(T)',1000);
}
//-->
</script>
</head>
<body><table border='0' width=250 height=50>
<tr valign='middle'>
<td align='center'>
<form name=form>
<input type=button value='Random Number Picker' onClick="lotto();StOp()">
</form>
<span id=layer1 class=a1>Results</span>
</td>
</tr>
</table>
</body>


Thanks, any help would be great.
_________________
Unknown Webmaster, Confused Game Player
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address Yahoo Messenger
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:34
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2018
Offline

PostPosted: Fri Apr 29, 2005 10:14 pm    Post subject: Reply to topic Reply with quote

Why put it in 'Misc User Apps'?
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Fri Apr 29, 2005 11:02 pm    Post subject: Reply to topic Reply with quote

I dunno, I'm not too hot on js, but that code looked very like a very round-a-bout way of doing it.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Solid_Fire
Server Help Squatter


Age:34
Gender:Gender:Male
Joined: Dec 22 2004
Posts: 327
Location: NV. Dont stalk me..plz..
Offline

PostPosted: Fri Apr 29, 2005 11:58 pm    Post subject: Reply to topic Reply with quote

purge, because it doesnt go in any other catergory ..it has nothin to do with SS..
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address Yahoo Messenger
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:36
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sat Apr 30, 2005 3:50 am    Post subject: Reply to topic Reply with quote

Then post it in Trash Talk, heh.

I agree with Cyan, too bad I have no idea how to fix your problem.
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sat Apr 30, 2005 11:19 am    Post subject: Reply to topic Reply with quote

document.write(""); is your friend. (or is .print lol)...
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Misc User Apps All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 671 page(s) served in previous 5 minutes.

phpBB Created this page in 0.453170 seconds : 31 queries executed (94.4%): GZIP compression disabled