1type Grid = Vec<Vec<bool>>;
2
3pub fn instantiate_grid(dimension: u8, execute: bool) {
5 let mut cmd = "cargo contract instantiate --suri //Alice --execute --args".to_string();
6 let grid: Grid = vec![vec![false; dimension as usize]; dimension as usize];
7 let grid = format!("{:?}", grid);
8 let grid = grid.replace(" ", "");
9 cmd = format!("{} {}", cmd, grid);
10 println!("{cmd}");
11 if execute {
12 let output = std::process::Command::new("sh")
13 .arg("-c")
14 .arg(cmd)
15 .output()
16 .expect("failed to execute process");
17 println!("status: {}", output.status);
18 println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
19 println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
20 }
21}