From f571a6b3e7df08e78daf4ec4d03aa2e1af1dfc99f8cf31e61a83d89a659d6765 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 19 Apr 2024 00:00:00 +0000 Subject: Make first square always be transparent This is to make patterns at extreme skew values look similar. --- src/hitomezashi.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hitomezashi.rs b/src/hitomezashi.rs index dede1ac..24a59be 100644 --- a/src/hitomezashi.rs +++ b/src/hitomezashi.rs @@ -34,7 +34,8 @@ pub fn hitomezashi(width: usize, height: usize, skew: Option) { let mut rng = rand::thread_rng(); let brn = Bernoulli::new(skew).unwrap(); - let init_bit: bool = rng.gen::(); + // the first square (upper left corner) is always transparent + let init_bit: bool = true; let mut row_bits: Vec = Vec::with_capacity(height - 1); let mut col_bits: Vec = Vec::with_capacity(width - 1); -- cgit v1.2.3