change example code
This commit is contained in:
parent
4a7d1bde43
commit
f1e3b888bd
@ -13,16 +13,16 @@ fn p<T: Copy + Default>(i: [T; 32]) -> [T; 32] {
|
||||
|
||||
fn main() {
|
||||
let i: [u8; 32] = [
|
||||
1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0,
|
||||
0, 0,
|
||||
1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1,
|
||||
0, 1,
|
||||
];
|
||||
p(i).iter().for_each(|i| print!("{}", i));
|
||||
println!();
|
||||
|
||||
let p = &[
|
||||
true, false, false, false, false, false, true, false, false, true, false, true, true,
|
||||
false, false, true, true, true, false, true, false, true, true, true, false, false, true,
|
||||
true, true, false, true, true,
|
||||
true, false, false, false, false, false, true, false, false, true, true, true, true, false,
|
||||
false, true, true, true, false, true, false, true, true, true, true, false, true, true,
|
||||
true, false, true, true,
|
||||
];
|
||||
let l0 = &[
|
||||
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
|
||||
@ -36,4 +36,14 @@ fn main() {
|
||||
.map(|x| if x { '1' } else { '0' })
|
||||
.for_each(|x| print!("{}", x));
|
||||
println!();
|
||||
|
||||
let lo = b"11111111111111111111111111111101";
|
||||
let ln = b"11111111111111111111111111111111";
|
||||
let cl = lo.iter().zip(ln.iter()).filter(|(a, b)| a != b).count();
|
||||
println!("cl = {}", cl);
|
||||
|
||||
let ro = b"01111101101001100010100011000100";
|
||||
let rn = b"01111101100001100010100001000100";
|
||||
let cr = ro.iter().zip(rn.iter()).filter(|(a, b)| a != b).count();
|
||||
println!("cr = {}", cr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user