diff options
-rw-r--r-- | src/hitomezashi.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hitomezashi.rs b/src/hitomezashi.rs index b39cace..6fb785e 100644 --- a/src/hitomezashi.rs +++ b/src/hitomezashi.rs @@ -55,8 +55,10 @@ pub fn hitomezashi(width: usize, height: usize, skew: Option<f64>) { let mut alt_bits: Vec<bool> = Vec::with_capacity(width); - for col in 0..alt_bits.capacity() { - alt_bits.push(col % 2 == 1); + let mut alternator: bool = false; + for _ in 0..alt_bits.capacity() { + alt_bits.push(alternator); + alternator = !alternator; } // each new row of the pattern depends on the bits directly above it |