Browse Source

docs(copy, tic_tac_toe): Improve code example and console output

by putting output only in the console output and removing it from the code as comment
pull/1372/head
Michele Sessa 2 years ago
parent
commit
067b3d6f42
  1. 4
      subjects/copy/README.md
  2. 4
      subjects/tic_tac_toe/README.md

4
subjects/copy/README.md

@ -40,13 +40,9 @@ fn main() {
let c = vec![1, 2, 4, 5];
println!("{:?}", nbr_function(a));
// output : (0, 1.0, inf)
println!("{:?}", str_function(b));
// output : ("1 2 4 5 6", "2.718281828459045 7.38905609893065 54.598150033144236 148.4131591025766 403.4287934927351")
println!("{:?}", vec_function(c));
// output : ([1, 2, 4, 5], [0.0, 0.6931471805599453, 1.3862943611198906, 1.6094379124341003])
}
```
And its output:

4
subjects/tic_tac_toe/README.md

@ -40,7 +40,7 @@ fn main() {
vec!["X", "#", "X"]
])
);
// "Tie"
println!(
"{:?}",
tic_tac_toe(vec![
@ -49,7 +49,6 @@ fn main() {
vec!["#", "O", "X"]
])
);
// "player O won"
let dig = vec![
vec!["O", "O", "X"],
@ -58,7 +57,6 @@ fn main() {
];
println!("{:?}",tic_tac_toe(dig));
// "player X won"
}
```

Loading…
Cancel
Save