The Daily Click ::. Forums ::. General Chat ::. Arrays are pure evil!
 

Post Reply  Post Oekaki 
 

Posted By Message

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
21st March, 2009 at 09:19:18 -

Well my array has 10000 Z, take that as ridicoulus.
Not to mention 9600 are preserved to be identified with a number*100, hence it freaked me out when i made some stuff.
Hence arrays are evil.

 
Code me a sausage!

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
21st March, 2009 at 09:20:36 -

yeah well for one. thats NOT a good idea. to have an array with a depth that large. how large are the first two dimensions?

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
21st March, 2009 at 10:03:42 -

a 10000x10000x10000 array storing integers would take up 3725 gigabytes, wouldn't it?

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
21st March, 2009 at 10:08:26 -

first is 20 second is 10., 20x10x10000
it takes 7 Mb

I dont know how much would a 10000x10000x10000 would take space, but i dont really wanna try it.

Edited by Don Luciano

 
Code me a sausage!

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
21st March, 2009 at 10:53:46 -


Originally Posted by Pixelthief
a 10000x10000x10000 array storing integers would take up 3725 gigabytes, wouldn't it?



if it were an integer array, yup.

what the hell do you need a depth of 10,000 for anyway Don?

 
n/a

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
21st March, 2009 at 14:01:05 -

Well it's a bit hard to explain, but i need 96 units each holding 100 values more or less. Thus i need 10,000. Since each 20x10 can be filled with 96 units.
actually thats 9600 per slot, but whatever.

It's a dark and a mysteriuos way to make some things

 
Code me a sausage!

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
21st March, 2009 at 17:28:00 -

each space in within the 20x10 can have 96 units? goddamn see this would never even be done in c++. you would have a linked list class of units each with the array storage space they need. way more efficient. any looping you do on that array is gonna kill serious cpu, especially with mmfs overhead, unless you can pull off the crazy shit pixeltheif does with loops.

just another question but W! T! F! do you need 19,200 units for!!?? 20x10 = 200, each with 96 units 200x96 = 19,200

Edited by Cecilectomy

 
n/a

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
21st March, 2009 at 20:56:32 -

There is no need for much loops on the array, Only loop i need is loopindex*100 = that unit. since when i read only one value linking the unit to its space in the array, thats mostly just reading and writing to the array. And the game is turn based, so not much hassle there.

And i dont really need 19200 units, but thats the maximum there can be on the whole map, the array will be used only like 5% of its size, but still, its kinda cool.
If you for say decide to build 200 full fleets, you will fill the array 100%. But thats just ridicoulus.

Edited by Don Luciano

 
Code me a sausage!

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
22nd March, 2009 at 05:49:39 -

Dude, I think the biggest problem is the processing power (or programming) it'd take to read and utilize 19200 units Oh, right, cecil said that

You should reconsider your design, though. If you're using that much stuff, you're being horribly inefficient somewhere.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
22nd March, 2009 at 12:11:30 -

Yeah i know, but im good with arrays, the loading time is really fast, and there is no problem at all.
I only loop the current x and y of the whole array, using loopindex*100 of Z, only making 96 loops. And thats the biggest loop i need, and will need.
So the processing is really fast, almost instant. The loading and saving the array to a file is the only thing that actually takes a few seconds.

 
Code me a sausage!
   

Post Reply



 



Advertisement

Worth A Click