Compare commits

..

No commits in common. "38a5d2d36d5c70486e5f50e7f437fd392c7911ce" and "77805f75cf51b7e7e9fbf5662d68fdd7f79cb728" have entirely different histories.

3 changed files with 5 additions and 7 deletions

View File

@ -46,7 +46,7 @@
Change output specification by scrolling (up => 1, down => 0), typing (=> 1, 0) or deleting (=> -).
</p>
<p id="examples">
Load <a href="#--111100">example 1</a>, <a href="#-1111000-1-01---">example 2</a>, <a href="#11101111111111111111101111111101">example 3</a>, <a href="#11101111111111111111101111111101--------------0-------1----------------------1--------------0----------1-----1-1------0-----0-0-">example 4</a>.
Load <a href="#--111100">example 1</a>, <a href="#-1111000-1-01---">example 2</a>, <a href="#11101111111111111111101111111101">example 3</a>.
Set all cells to <button id="set-0">0</button>, <button id="set-1">1</button> or <button id="set-any">-</button>.
</p>
<div id="input-container"></div>

View File

@ -7,11 +7,10 @@ const SIZE_FACTOR: usize = 64;
fn main() {
let args = args().collect::<Vec<_>>();
let vars = [A, B, C, D, E];
let vars = [A, B, C, D];
//let function = vec![0, 0, 1, 1, 1, 1, 1, 0].into_iter().map(Into::into).collect();
//let function = vec![0, 0, 1, 1, 1, 1, 1, 2].into_iter().map(Into::into).collect();
//let function = parse_function("-1111000-1-01---");
let function = parse_function("11101111111111111111101111111101");
let function = parse_function("-1111000-1-01---");
let groups = find_groups(&function, &vars, One);
eprintln!("all:");
for x in &groups {
@ -46,5 +45,5 @@ fn main() {
.collect()
};
println!("{}", svg::get_svg(SIZE_FACTOR, true, &function, &vars, &block_masks));
println!("{}", svg::get_svg(SIZE_FACTOR, false, &function, &vars, &block_masks));
}

View File

@ -74,8 +74,7 @@ pub fn get_svg(size_factor: usize, print_labels: bool,
if print_labels {
for i in 0..vars.len() {
let offset = (i / 4) as f32 * size2 + size16;
let initial_window = 2usize.pow((i / 2) as u32);
//eprintln!("i = {i}, offset = {offset}, initial_window = {initial_window}");
let initial_window = 2usize.pow(((i + 2) / 4) as u32);
let mut start = vec![false; initial_window];
start.extend(vec![true; initial_window]);
let desired_len = if i % 2 == 0 { w } else { h };