Function
get_opposite
(sym: &Symmetry, loc: (usize, usize), width: usize, height: usize)
Source from the content-addressed store, hash-verified
| 100 | None |
| 101 | } |
| 102 | fn get_opposite(sym: &Symmetry, loc: (usize, usize), width: usize, height: usize) -> Option<(usize, usize)> { |
| 103 | match sym { |
| 104 | &Symmetry::Horiz => Some((width - 1 - loc.0, loc.1)), |
| 105 | &Symmetry::Vert => Some((loc.0, height - 1 - loc.1)), |
| 106 | &Symmetry::Spiral => Some((width - 1 - loc.0, height - 1 - loc.1)), |
| 107 | &Symmetry::None => None |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | #[derive(Clone)] |
| 112 | struct Thing { |
Tested by
no test coverage detected