ID:273917
 
Well, i have this piece of code i've done:

var
list/DamageChart[116][17]


proc/InitializeDamageChart() {
DamageChart[1][1] = 1
DamageChart[2][1] = 1

}


However, i wont be doing over 200 "DamageChart[X][X] = X" I'm trying to do a Chart for this: http://www.serebii.net/games/type.shtml
Any better way to do it without that way?
You need some sort of formula or procedure for calculating a general entry. I don't know the formula, nor do I readily see it from scanning over the chart you linked.

var
list/DamageChart[116][17]

proc/InitializeDamageChart() {
for (var/i = 1, i <= 116, i++)
for (var/j = 0, j <= 17, j++)
var/damage
(code to calculate damage)
DamageChart[i][j] = damage
}


In the absence of a formula, though, you could write a proc such as SetRow(), which takes 18 parameters (one to indicate the row, the rest to indicate the entries), in order to streamline the typing.

On an unrelated note, beware of hard-coding the dimensions of the array, if there is the slightest change you may want to modify it in the future.
In response to Pepper2000
Pepper is right making an ArrayList is usually a better idea then a hard coded Array.
In response to Legato_frio
I dont think theres a formula to calculate damage. Its just a table... hm.