diff options
| author | jacksonfu14 <jackson@fashionunited.com> | 2025-11-06 09:06:23 +0100 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2025-11-06 09:06:23 +0100 |
| commit | 52d6f51b11ad7144ecef02ecd8710528076a67a4 (patch) | |
| tree | fd6e84925f5cac26adb3405be19b072f0a9176d8 /morphology/examples | |
| parent | 743bf0f56e566f9d7b7671805a81704c3b7b14c2 (diff) | |
feat: pretty print meta-affine values
Diffstat (limited to 'morphology/examples')
| -rw-r--r-- | morphology/examples/pretty_print_demo.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/morphology/examples/pretty_print_demo.rs b/morphology/examples/pretty_print_demo.rs new file mode 100644 index 0000000..2760962 --- /dev/null +++ b/morphology/examples/pretty_print_demo.rs @@ -0,0 +1,36 @@ +//! Demonstration of the pretty_print function +//! +//! Compile and run: +//! cargo run --example pretty_print_demo + +use meta_affine::Value; + +fn main() { + println!("Pretty Print Demonstration\n"); + println!("{}", "=".repeat(50)); + + let examples = vec![ + (0, 0), + (0, 1), + (1, 0), + (-1, 0), + (1, 3), + (2, 1), + (-3, 2), + (5, 7), + (-5, 7), + (4, -8), + (-4, -8), + ]; + + for (outer, inner) in examples { + let value = Value::new(outer, inner); + println!( + "{:10} -> {}", + format!("{}", value), + value.pretty_print() + ); + } + + println!("{}", "=".repeat(50)); +} |