Skip to content
Snippets Groups Projects
Commit d707f9d3 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

Merge branch 'control_bis' into 'main'

old and new control merged

See merge request orestis.malaspin/rust-101!49
parents a1412887 5535f272
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ fn main() { ...@@ -30,6 +30,7 @@ fn main() {
} else { } else {
0 // pas de ; 0 // pas de ;
}; // attention au ; }; // attention au ;
println!("Le signe de x est {sign}.");
} }
``` ```
...@@ -37,10 +38,8 @@ fn main() { ...@@ -37,10 +38,8 @@ fn main() {
```rust [] ignore ```rust [] ignore
fn main() { fn main() {
let mut x = 0;
loop { loop {
println!("En boucle!"); println!("En boucle!");
x += 1;
} }
} }
``` ```
...@@ -87,12 +86,7 @@ fn main() { ...@@ -87,12 +86,7 @@ fn main() {
println!("Fin de la boucle!"); println!("Fin de la boucle!");
} }
``` ```
- `0..10` de `0` à `10` non inclus.
- `0..10` est une `Range` (une collection).
## La boucle `for` ++
```rust ignore
for i in collection {
// instructions
}
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment