HI all, i’m trying to load the information for a simple maze architecture from a text file. The text file is in the form
where "0" are empty blocks (streets) and "1" are building blocks.
What is the best way to do that? then i have to access it to build a jitter GL plan of it for exploration. I used a text object but it’s not so easy. Maybe there is a matrix text loader or something. Any suggestion on how to proceed?
Break apart any line like
0 1 0
by using [iter].
Then you have rows of 0 or 1 values, which you can load into a [jit.matrix] by using [jit.fill] per line.
Or, try and load the whole file into a matrix at once using [jit.textfile]. When I tried it, the matrix was ASCII characters: so 010 became 48 49 48. That could be used the same as 0 1 0 but you’d just need a different [sel] at the point you’re using it: [sel 48 49] versus [sel 0 1]. Either way, you can then tell [jit.sketch] to make a building or not :)