How to fill a matrix with a checkerboard pattern?
Does anyone know a nice elegant way to fill a matrix with a checkerboard pattern?
Let's say for example that the two colours will be cyan and magenta. Also, each square will be just one cell of the matrix.
I could use uzi and counter to loop through all the odd cells and then all the even cells, but I'm guessing there's a more efficient way.
jit.bfg, check the help, third tab "checker"
Would that do ?
Yes, I did see that shortly after I posted! I will experiment... I need to find the right settings so that the pattern matches up perfectly to the resolution of the matrix - one square per cell/pixel.
You could also investigate using [jit.expr] with the cell arguments
I'd say, just do it once with uzi and you're done with it in a few microseconds never to worry about it again.
A simple and efficient technique would be to use jit.gen along with [cell] [%] and [
Yes, gen is great for cellwise stuff.