Browse Source

Merge pull request #1372 from 01-edu/DEV-3155-inconsistent-style-in-examples

docs(copy, tic_tac_toe): Improve code example and console output
pull/1392/head
Michele 2 years ago committed by GitHub
parent
commit
5b870400ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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