mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -11,6 +11,30 @@ The Odin programming language is fast, concise, readable, pragmatic and open sou
|
|||||||
|
|
||||||
Website: [https://odin.handmade.network/](https://odin.handmade.network/)
|
Website: [https://odin.handmade.network/](https://odin.handmade.network/)
|
||||||
|
|
||||||
|
```go
|
||||||
|
import "core:fmt.odin"
|
||||||
|
|
||||||
|
main :: proc() {
|
||||||
|
program := "+ + * 😃 - /";
|
||||||
|
accumulator := 0;
|
||||||
|
|
||||||
|
for token in program {
|
||||||
|
switch token {
|
||||||
|
case '+': accumulator += 1;
|
||||||
|
case '-': accumulator -= 1;
|
||||||
|
case '*': accumulator *= 2;
|
||||||
|
case '/': accumulator /= 2;
|
||||||
|
case '😃': accumulator *= accumulator;
|
||||||
|
case: // Ignore everything else
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.printf("The program \"%s\" calculates the value %d\n",
|
||||||
|
program, accumulator);
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## Demonstrations:
|
## Demonstrations:
|
||||||
* First Talk & Demo
|
* First Talk & Demo
|
||||||
- [Talk](https://youtu.be/TMCkT-uASaE?t=338)
|
- [Talk](https://youtu.be/TMCkT-uASaE?t=338)
|
||||||
|
|||||||
Reference in New Issue
Block a user