Skip to content

Instantly share code, notes, and snippets.

@fatihgokce
Created August 8, 2019 09:49
Show Gist options
  • Save fatihgokce/c231fdcf7353ce20060de126cbac5998 to your computer and use it in GitHub Desktop.
Save fatihgokce/c231fdcf7353ce20060de126cbac5998 to your computer and use it in GitHub Desktop.
fn main() {
let rows=3;
let cols=4;
let mut state = [[ 0u8; 4]; 2];
//let mut state = [[0u8; 4]; 5];
state[0][1] = 42;
//println!("{:?}",state);
for (r,v) in state.iter().enumerate(){
println!("{:?}",v);
}
let mut v = vec![vec![0; cols]; rows];
v[0][0] = 1;
//println!("{:?}",v);
let width=2;
let height=2;
let cells:Vec<i8> = (0..width * height)
.map(|i| {
if i % 2 == 0 || i % 7 == 0 {
1
} else {
0
}
})
.collect();
//println!("{:?}",cells);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment