patterns-run

patterns-run

Collection of snippets to render logical patterns

arrow-bottom-right

Back to gallery
const size = 5;

for (let i = 0; i < size; i++) {
  for (let j = 0; j < size; j++) {
    const line = i === j;
    const head = i > size - j - 2;

    print(line || head ? "* " : "  ");
  }
  newline();
}