MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / zigzag

Function zigzag

fl16-inputmodules/src/patterns.rs:346–372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344}
345
346pub fn zigzag() -> Grid {
347 let mut grid = Grid::default();
348
349 // 1st Right to left
350 for i in 0..WIDTH {
351 grid.0[i][i] = 0xFF;
352 }
353 // 1st Left to right
354 for i in 0..WIDTH {
355 grid.0[WIDTH - 1 - i][WIDTH + i] = 0xFF;
356 }
357 // 2nd right to left
358 for i in 0..WIDTH {
359 grid.0[i][2 * WIDTH + i] = 0xFF;
360 }
361 // 2nd left to right
362 for i in 0..WIDTH {
363 if 3 * WIDTH + i < HEIGHT {
364 grid.0[WIDTH - 1 - i][3 * WIDTH + i] = 0xFF;
365 }
366 }
367
368 // Finish it off nicely
369 grid.0[1][33] = 0xFF;
370
371 grid
372}
373
374pub fn every_nth_col(n: usize) -> Grid {
375 let mut grid = Grid::default();

Callers 2

nextMethod · 0.85
handle_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected