chiark / gitweb /
wip print-opt-orient
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Oct 2022 21:05:53 +0000 (22:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Oct 2022 21:07:00 +0000 (22:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/print-opt-orient.rs [new file with mode: 0644]

diff --git a/src/bin/print-opt-orient.rs b/src/bin/print-opt-orient.rs
new file mode 100644 (file)
index 0000000..70cc60c
--- /dev/null
@@ -0,0 +1,21 @@
+
+use z3_treefoil::*;
+
+fn main() -> io::Result<()> {
+  for shape1 in read_vertices() {
+    let rots = shape_all_rotations(&shape1)
+      .enumerate()
+      .map(|(i, shape)| {
+        let weight = 0;
+        (weight, i, shape)
+      })
+      .collect_vec();
+
+    for (weight, _, shape) in rots {
+      print!("{} ", weight);
+      print_shape(&shape)?;
+    }
+  }
+
+  Ok(())
+}