Feature Overview
RCEACH() performs a two-dimensional loop in a single function.
- The rectangle value arguments correspond to [table] {x,y,w,h} and [string] "x y w h".
- You can refer to the current x and y values in the specified function.
- This function consumes 50 Token.
rceach({16,16,32,32},function(x,y,r) local c=(x+y)%8+8 pset(x,y,c) end) |
One of KNUTIL's functions, the object generated by EXRECT(), has a rectangle value format to be used for the RCEACH() argument.
may want to Use DMP() if check the converted table.
This function is included in the KNUTIL library.
interesting construct but per-pixel operations are super costly on Pico.
usually better to find ‘block’ alternative.
@freds72
Ah, yes! You are right.
My post is simple in the look of the code and something that can be tried quickly. (I'm not considering cpu cost)
BTW, what does the 'block' you are referring to indicate?
[Please log in to post a comment]