now where the value in the above array is less than 2 the value in the second grid is 100
otherwise the value is calculated from the surrounding values dependent on the
id the difference between the number that is next to it in the first grid is <2 then 10% rounded down to the nearest int is added to the value of the 2nd array
if the difference is >=2 then 5% is added
so
so if the first array looked like
1 1 1
1 3 1
1 1 1
then the 2nd array would be
100 100 100
100 40 100
100 100 100
ie 100 hundred for every 1 under 2 and the 3 is 5% of each surrounding value
however if it was
1 1 1 1
1 3 3 1
1 3 3 1
1 1 1 1
then each of the 3's values is dependent on the value in each of the other 3's
and i can't think of any way of solving this without ending up in a recursive loop or wrong values
Can anyone help either figure out the maths or the code for that?
__________________
Definition of a Beginner, Someone who doesn't know the rules.
Definition of an Expert, Someone who knows when to ignore the rules.
ok this is just me thinking out loud trying to work on that solution but the thinking might help you help me
doing the calc for the above example manually
each of the 3's gets a base value of 25 from the surrounding <2
@ 25 they leach 2 from the surrounding 3's raising them to 31
@31 they leach 3 from the surrounding 3's raising them to 34 as 2 was already added
@34 they are still leaching 3 so nothing needs to change
__________________
Definition of a Beginner, Someone who doesn't know the rules.
Definition of an Expert, Someone who knows when to ignore the rules.
I have a hard time to understand exactly what you are trying to acomplish? Does this serve an actual purpose? If so what is it? or is it more a programmer puzzle
Can you post any code you have so far?
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
i've simplified the numbers to make it easier to understand as its the process i'm stuggling with and that doesn't change what ever the figures and this is only a sub section of the overall problem.
basically its a very simplified model of how a liquid diffuses though a permeable solid
__________________
Definition of a Beginner, Someone who doesn't know the rules.
Definition of an Expert, Someone who knows when to ignore the rules.
Sorry for not replying yet. First of I'm still on vacation, so in slow mode but second I am having a hard time figuring this out. Am still looking though.
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Well can't really see anything wrong with it. Then again I don;t see the Classes Map and Tile.
Dont know if you are having any performance issues or something with large arrays. If so, just post the 2 other classes too
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish