Static White Pattern

No prob. I’m assuming you’re not looking to be taught how to fish here.

This should get it done for you.

var offset = 0 // How far to start from the left
var onCount = 5
var every = 20

export function render(index) {
  on = mod(index - offset, every) < onCount
  hsv(0, 0, on)
}

// You only need this on PB v2
function mod(dividend, divisor) {
  var res = dividend % divisor
  if ((res != 0) && (res > 0) != (divisor > 0)) { //this compares the sign of both
    res += divisor
  }
  return res
}

Edit: The guy who asked for a builtin mod() (me) forgot to use it correctly :expressionless: Now it’s fixed in the above, with Wizard’s mod polyfill for v2 users.

3 Likes