Files
uutils-term-grid/examples/basic.rs
T
Ben S b57bf4541c Separate grid creation from grid displaying
Since I wanted to add a 'display in n columns' method, the maximum width of the console would never be relevant, so this had to get moved to a parameter. The Display stuff is just a bonus.
2015-06-22 21:52:13 +01:00

16 lines
354 B
Rust

extern crate term_grid;
use term_grid::{Grid, GridOptions, Direction};
fn main() {
let mut grid = Grid::new(GridOptions {
direction: Direction::TopToBottom,
separator_width: 2,
});
for i in 0..40 {
grid.add(format!("{}", 2_isize.pow(i)).into())
}
println!("{}", grid.fit_into_width(40).unwrap());
}