mirror of
https://gitlab.kit.edu/uskyk/kv.git
synced 2024-11-22 17:05:05 +00:00
Compare commits
No commits in common. "38a5d2d36d5c70486e5f50e7f437fd392c7911ce" and "77805f75cf51b7e7e9fbf5662d68fdd7f79cb728" have entirely different histories.
38a5d2d36d
...
77805f75cf
@ -46,7 +46,7 @@
|
|||||||
Change output specification by scrolling (up => 1, down => 0), typing (=> 1, 0) or deleting (=> -).
|
Change output specification by scrolling (up => 1, down => 0), typing (=> 1, 0) or deleting (=> -).
|
||||||
</p>
|
</p>
|
||||||
<p id="examples">
|
<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>.
|
Set all cells to <button id="set-0">0</button>, <button id="set-1">1</button> or <button id="set-any">-</button>.
|
||||||
</p>
|
</p>
|
||||||
<div id="input-container"></div>
|
<div id="input-container"></div>
|
||||||
|
@ -7,11 +7,10 @@ const SIZE_FACTOR: usize = 64;
|
|||||||
fn main() {
|
fn main() {
|
||||||
let args = args().collect::<Vec<_>>();
|
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, 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 = 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("-1111000-1-01---");
|
||||||
let function = parse_function("11101111111111111111101111111101");
|
|
||||||
let groups = find_groups(&function, &vars, One);
|
let groups = find_groups(&function, &vars, One);
|
||||||
eprintln!("all:");
|
eprintln!("all:");
|
||||||
for x in &groups {
|
for x in &groups {
|
||||||
@ -46,5 +45,5 @@ fn main() {
|
|||||||
.collect()
|
.collect()
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("{}", svg::get_svg(SIZE_FACTOR, true, &function, &vars, &block_masks));
|
println!("{}", svg::get_svg(SIZE_FACTOR, false, &function, &vars, &block_masks));
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,7 @@ pub fn get_svg(size_factor: usize, print_labels: bool,
|
|||||||
if print_labels {
|
if print_labels {
|
||||||
for i in 0..vars.len() {
|
for i in 0..vars.len() {
|
||||||
let offset = (i / 4) as f32 * size2 + size16;
|
let offset = (i / 4) as f32 * size2 + size16;
|
||||||
let initial_window = 2usize.pow((i / 2) as u32);
|
let initial_window = 2usize.pow(((i + 2) / 4) as u32);
|
||||||
//eprintln!("i = {i}, offset = {offset}, initial_window = {initial_window}");
|
|
||||||
let mut start = vec![false; initial_window];
|
let mut start = vec![false; initial_window];
|
||||||
start.extend(vec![true; initial_window]);
|
start.extend(vec![true; initial_window]);
|
||||||
let desired_len = if i % 2 == 0 { w } else { h };
|
let desired_len = if i % 2 == 0 { w } else { h };
|
||||||
|
Loading…
Reference in New Issue
Block a user