Screen Printer is a rust crate that will allow you to build and print arrays of data into a grid format.
The purpose of this crate is to make it easier to print a grid that's stored in an array.
```rust use screen_printer::printer::*;
const WIDTH: usize = 5; const HEIGHT: usize = 4;
fn main() { let character_list = vec![ "a", "b", "c", "d", "e", // "f", "g", "h", "i", "j", // "k", "l", "m", "n", "o", // "p", "q", "r", "s", "t", ];
let grid = Printer::creategridfromfullcharacterlist(&characterlist, WIDTH, HEIGHT).unwrap();
print!("{}", "\n".repeat(HEIGHT * 2)); // This gives the grid space for the first print Printer::printoverprevious_grid(grid, HEIGHT); } ```
```rust use screen_printer::printer::*;
const WIDTH: usize = 3; const HEIGHT: usize = 3;
fn main() { let mut printer = Printer::new(WIDTH, HEIGHT);
let grid1rows = vec!["abc", "123", "xyz",]; let grid2rows = vec!["abc", "789", "xyz",];
let grid1 = Printer::creategridfrommultiplerows(&grid1rows).unwrap(); let grid2 = Printer::creategridfrommultiplerows(&grid1rows).unwrap();
printer.dynamicprint(grid1).unwrap(); printer.dynamicprint(grid2).unwrap(); } ```