Screen Printer

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.

Examples

Creating and Printing a Grid

```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); } ```

Using the dynamic print method

```rust,norun use screenprinter::printer::*;

const WIDTH: usize = 3; const HEIGHT: usize = 3;

fn main() { let mut printer = Printer::new(WIDTH, HEIGHT);

// get the grid data let grid1rows = vec!["abc", "123", "xyz",]; // create the grid let grid1 = Printer::creategridfrommultiplerows(&grid1rows).unwrap(); // print the first grid, using said grid as a // basis for all future grids printer.dynamicprint(grid_1).unwrap();

// get the grid data let grid2rows = vec!["abc", "789", "xyz",]; // create the grid let grid2 = Printer::creategridfrommultiplerows(&grid1rows).unwrap(); // print only the differences in the grid from the previous one printer.dynamicprint(grid_2).unwrap(); } ```

This will result in

bash,no_run abc 123 xyz

Into

bash,no_run abc 789 < only line that was actually printed xyz