Update Examples

Glen Whitney 2024-08-25 03:56:26 +00:00
parent e61bb2b358
commit eaa00d4081

@ -718,3 +718,95 @@ fn main
println! "{} -> {}", n, big_n
```
</td></tr></table>
#### loop
<table>
<tr>
<th>Rust</th>
<th>Husht</th>
</tr>
<tr>
<td>
```
fn main() {
let mut count = 0u32;
println!("Let's count until infinity!");
loop {
count += 1;
if count == 3 {
println!("three");
continue;
}
println!("{}", count);
if count == 5 {
println!("OK, that's enough");
break;
}
}
}
```
</td><td>
```
fn main
let mut count = 0u32
println! "Let's count until infinity!"
loop
count += 1
if count == 3
println! "three"
continue
println! "{}", count
if count == 5
println! "OK, that's enough"
break
```
</td></tr></table>
##### Nesting and labels
<table>
<tr>
<th>Rust</th>
<th>Husht</th>
</tr>
<tr>
<td>
```
```
</td><td>
```
```
</td></tr></table>
##### Returning from loops
<table>
<tr>
<th>Rust</th>
<th>Husht</th>
</tr>
<tr>
<td>
```
```
</td><td>
```
```
</td></tr></table>