/    Sign up×
Community /Pin to ProfileBookmark

196,940,000 entries; a math challenge

Morning everybody. new to this forum. be gentle.

i’m having trouble setting up the math for this, and its prolly easier than i think.

i would like to create an array creator. where there is one array with 16,205 more arrays in it. and 12,153 entries within each of those. to start i’d like just a designation number to be in each of the 196 million plus spots and later i’ll write code to replace the number of the users choice with a name or something.

note: the idea for this website is to represent every square mile on the planet with a number, and display it in a 3×4 ratio

would it be easier to just create one long 196mil+ array and write seperate code for how its displayed?

also, can internet explorer even display a page with so may numbers on it? in the final version the table wont be displayed but i might want to try to see if my code is working.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@VladdyFeb 10.2004 — If you are willing to see when it crashes:
[CODE]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb">
<head>
<title>Huge Array</title>
<style type="text/css">

</style>
<script type="text/javascript">
var bigArray = null;
function createArray()
{ bigArray = new Array()
createRow();
return;
}

function createRow()
{ bigArray.push(new Array());
for(var j=0; j<12153; j++)
{ bigArray[bigArray.length-1].push(j*bigArray.length+j);
}
window.status = 'Row ' + bigArray.length + ' created';
if(bigArray.length<16205) setTimeout('createRow()',1000);
return;
}

</script>
</head>

<body>
<button onclick="createArray()">Create Array</button>
</body>
</html>
[/CODE]
Copy linkTweet thisAlerts:
@sydeffexauthorFeb 11.2004 — i appreciate the help ? to bad its way to slow to have practical use. how about some code that will determine which of the 16205 arrays and where in the 12153 entries of each array a users number (1-196940000) should be placed? that way the whole array wont have to be created before hand, just something that'll note which places are already taken.

i suppose you could do that by generating the name for the needed array bigArray[bigArrayNum16205[12153]] but it would take some crazy math to get the numbers right.
×

Success!

Help @sydeffex spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...