f09f
·288 words·2 mins
f09f #
pronounced fonf; is a simple statically typed language with simple but powerful syntax #
Include #
include standio;
Byte #
byte name = 10000000;
Byte array #
byte[] name;
byte name = [10000000, 10000001];
Char #
char letter = 'A';
Char array #
char[] letter;
char letter = ['A', 'B', 'C'];
Int #
int number = 4;
Int array #
int[] numbers;
int numbers = [2, 5, 4];
Prec #
prec percent = 3.4;
Prec array #
prec[] precise_numbers;
prec precise_numbers = [3.14, 2.71828, 4.222];
Ptr #
ptr my_variable = 0x494949;
String #
string name = "Jake";
Bool #
isRunning = True;
If #
if (num > 0) {
~ do thing ~
}
Else if #
if (name == "Jake") {
~ do thing ~
} else {
~ do other things ~
}
If #
if (val < physics.gravity) {
~ val is less than gravity ~
} else if (val < physics.gravity / 2) {
~ val is less than half gravity ~
} else {
~ val is greater than gravity ~
}
Function #
function foo (int age, int height) returns string {
return(age ^ height);
}
Return #
return(4);
Entry #
while () {
~ Looped code ~
}
Exit #
do {
~ Looped code ~
} while still ();
For #
loop for item in array {
~ Looped code ~
}
Classes #
class Lang (string name) {
~ constructor ~
self.name = name;
} : Main {
~ main body ~
function hello_lang () returns string {
return("Hello " + self.name());
}
}
Static #
static byte name = 10101010;
static char letter = 'A';
static ptr = 0x494949;
Burn #
burn string name = "Jake";