Last active
June 22, 2019 04:56
-
-
Save aisk/5734797 to your computer and use it in GitHub Desktop.
berserker lang hello world example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using std; | |
using assert; | |
func main = ()=> int { | |
list<int> l = [0, 1, 2, 3, 4, 5]; | |
dict<char*, int> d = { | |
"one": 1, | |
"two": 2, | |
"tree": 3, | |
}; | |
assert(l[1] == 1); | |
assert(d[1] == 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using stdio; | |
import string; | |
// berserker lang hello world example | |
func main = ()=> int { | |
add(1, 2); | |
char* msg = "Hello World!"; | |
string:strlen(msg); | |
prrintf(msg); | |
return 0; | |
} | |
func add = (int x, int y)=> int { | |
return x + y; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
// berserker lang hello world example | |
int add(int x, int y); | |
int main () { | |
add(1, 2); | |
char* msg = "Hello World!"; | |
strlen(msg); | |
prrintf(msg); | |
return 0; | |
} | |
int add (int x, int y) { | |
return x + y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment