From 52d6f51b11ad7144ecef02ecd8710528076a67a4 Mon Sep 17 00:00:00 2001 From: jacksonfu14 Date: Thu, 6 Nov 2025 09:06:23 +0100 Subject: feat: pretty print meta-affine values --- morphology/examples/pretty_print_demo.rs | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 morphology/examples/pretty_print_demo.rs (limited to 'morphology/examples') 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)); +} -- cgit v1.2.3