Home

The Odin programming language is designed with the intent of creating an alternative to C with the following goals: simplicity high performance built for modern systems joy of programming package main import "core:fmt" 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); }

Andrew Chou
Source: Home
Actions
Connections