summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2024-04-19 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2024-04-19 00:00:00 +0000
commitf571a6b3e7df08e78daf4ec4d03aa2e1af1dfc99f8cf31e61a83d89a659d6765 (patch)
tree4f73dfe10b29a97ef9af7e425962d88c9f2cd6da47c11fc28e97fde2fcac76cc /src
parent9722125a51e341e66e232134a3341486fdf9340bb47179349d9ed34df1adb246 (diff)
downloadhitomezashi-rs-f571a6b3e7df08e78daf4ec4d03aa2e1af1dfc99f8cf31e61a83d89a659d6765.tar.gz
hitomezashi-rs-f571a6b3e7df08e78daf4ec4d03aa2e1af1dfc99f8cf31e61a83d89a659d6765.zip
Make first square always be transparent
This is to make patterns at extreme skew values look similar.
Diffstat (limited to 'src')
-rw-r--r--src/hitomezashi.rs3
1 files changed, 2 insertions, 1 deletions
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<f64>) {
let mut rng = rand::thread_rng();
let brn = Bernoulli::new(skew).unwrap();
- let init_bit: bool = rng.gen::<bool>();
+ // the first square (upper left corner) is always transparent
+ let init_bit: bool = true;
let mut row_bits: Vec<bool> = Vec::with_capacity(height - 1);
let mut col_bits: Vec<bool> = Vec::with_capacity(width - 1);