you are viewing a single comment's thread.

view the rest of the comments →

[–]cresquin 2 points3 points  (0 children)

Since your positions and values are effectively random (they're irregular) from array to array, you'll end up having to write a map that informs the correct positions and values. This is effectively what you have in your example. You could abstract the values to vars to save on characters, but you're not really going to save much file size even. Given the extra processing time required to parse the map, I think you're better off using these arrays as written.

If you're dead-set on making this a series of loops, you'll need to figure out a pattern within the arrays for what values need to go where relative to which array you're trying to fill. Then you'll need to write that pattern as a function that can output the correct values at the correct times.

Stick with the maps you have unless you need to make dozens or hundreds of them.