Display better
This commit is contained in:
parent
0c097a72fb
commit
2b51bcff01
1 changed files with 8 additions and 3 deletions
|
|
@ -31,10 +31,15 @@ impl Formula {
|
|||
self.display_recursion(0, vec![&self.tree]);
|
||||
}
|
||||
fn display_recursion(&self, indent_level: u8, nodes: Vec<&Node>) {
|
||||
for node in nodes {
|
||||
for i in 0..nodes.len() {
|
||||
let node = nodes[i];
|
||||
if indent_level != 0 {
|
||||
for _ in 0..(indent_level) {
|
||||
print!("|\t");
|
||||
for j in 0..(indent_level) {
|
||||
if j == indent_level - 1 {
|
||||
print!("|__________");
|
||||
} else {
|
||||
print!(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
println!("{node}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue