JECS icon indicating copy to clipboard operation
JECS copied to clipboard

support for multi-dimensional arrays

Open JimmyCushnie opened this issue 5 years ago • 4 comments

probably the best way to do this is by treating them as nested arrays. A 2d array is saved the same was as an array of arrays, a 3d array is saved the same way as an array of arrays of arrays, ect

JimmyCushnie avatar Mar 30 '19 03:03 JimmyCushnie

You know it would be super exciting if you saved them as actual tables if they are 2D arrays. Something like this:

        Col0      Col1
Row0    val00     val01
Row1    val10     val11

But again, it is hard to implement and probably hard to use as well.

starikcetin avatar Oct 04 '19 12:10 starikcetin

An interesting idea! Yeah, the biggest drawback I see is that it will be hard to use. SUCC files should be easy to write from scratch, with confidence that what you write won't have parsing errors. Perhaps it would be good to have this as an option without it being the default.

JimmyCushnie avatar Oct 04 '19 13:10 JimmyCushnie

To prevent (or more realistically speaking, reduce) parsing errors, we might search for a separator character instead of relying on whitespace. For example:

         Col0,      Col1
Row0,    val00,     val01
Row1,    val10,     val11

Notice the commas.

starikcetin avatar Oct 04 '19 13:10 starikcetin

Ah, that's clever

JimmyCushnie avatar Oct 04 '19 13:10 JimmyCushnie