pub use std::io::Write as _;
pub use std::iter;
+pub use itertools::izip;
pub use itertools::Itertools as _;
pub fn default<T: Default>() -> T { Default::default() }
.map(|(&a,&b)| [a,b])
}
+pub fn all_flippings(shape: &Shape) -> impl Iterator<Item=Shape> + '_ {
+ iter::repeat([false,true].into_iter())
+ .take(DIM)
+ .multi_cartesian_product()
+ .map(|inv: Vec<bool>| {
+ shape.iter().map(|p| {
+ let mut inv = inv.iter();
+ p.map(|c| {
+ if *inv.next().unwrap() { MAX-c } else { c }
+ })
+ })
+ .collect_vec()
+ })
+}
+
pub fn print_shape(shape: &Shape) -> io::Result<()> {
let mut o = io::stdout().lock();
for vx in shape {