Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 1608e32

Browse files
author
Esteban Echeverry
committed
Change example.rs to a simpler and more welcoming one
1 parent d2fac04 commit 1608e32

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

_includes/example.rs

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
// This code is editable and runnable!
22
fn main() {
3-
// A simple integer calculator:
4-
// `+` or `-` means add or subtract by 1
5-
// `*` or `/` means multiply or divide by 2
6-
7-
let program = "+ + * - /";
8-
let mut accumulator = 0;
9-
10-
for token in program.chars() {
11-
match token {
12-
'+' => accumulator += 1,
13-
'-' => accumulator -= 1,
14-
'*' => accumulator *= 2,
15-
'/' => accumulator /= 2,
16-
_ => { /* ignore everything else */ }
17-
}
18-
}
19-
20-
println!("The program \"{}\" calculates the value {}",
21-
program, accumulator);
3+
println!("Hello");
4+
println!("Hola");
5+
println!("こんにちは");
6+
println!("您好");
227
}

0 commit comments

Comments
 (0)