mirror of
https://gitlab.kit.edu/uskyk/kv.git
synced 2024-11-21 16:35:00 +00:00
Compare commits
3 Commits
77805f75cf
...
38a5d2d36d
Author | SHA1 | Date | |
---|---|---|---|
|
38a5d2d36d | ||
|
0723f5df4b | ||
|
07e0ce40c4 |
@ -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>.
|
||||
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>.
|
||||
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>
|
||||
|
@ -7,10 +7,11 @@ const SIZE_FACTOR: usize = 64;
|
||||
fn main() {
|
||||
let args = args().collect::<Vec<_>>();
|
||||
|
||||
let vars = [A, B, C, D];
|
||||
let vars = [A, B, C, D, E];
|
||||
//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("-1111000-1-01---");
|
||||
let function = parse_function("11101111111111111111101111111101");
|
||||
let groups = find_groups(&function, &vars, One);
|
||||
eprintln!("all:");
|
||||
for x in &groups {
|
||||
@ -45,5 +46,5 @@ fn main() {
|
||||
.collect()
|
||||
};
|
||||
|
||||
println!("{}", svg::get_svg(SIZE_FACTOR, false, &function, &vars, &block_masks));
|
||||
println!("{}", svg::get_svg(SIZE_FACTOR, true, &function, &vars, &block_masks));
|
||||
}
|
||||
|
@ -74,7 +74,8 @@ 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) / 4) as u32);
|
||||
let initial_window = 2usize.pow((i / 2) as u32);
|
||||
//eprintln!("i = {i}, offset = {offset}, initial_window = {initial_window}");
|
||||
let mut start = vec![false; initial_window];
|
||||
start.extend(vec![true; initial_window]);
|
||||
let desired_len = if i % 2 == 0 { w } else { h };
|
||||
|
Loading…
Reference in New Issue
Block a user