Krills is Simple Programming Language.
git clone https://github.com/ejjang2030/krills.git
Then access to the directory which at the git cloned the files with cd
command in the terminal or cmd.
Run this command go run main.go
in the directory.
- Integer
- Boolean
- String
- Function
- Array
- HashMap
>> let n1 = 5;
>> let n2 = 10;
>> n1 + n2
15
let func1 = fun(x, y) {
x + y;
}
or
fun test(x) {
return x;
}
function identifier must not contain numbers
- Condition Loop
while: a.next() {
// statements
}
- for Loop
for: (let i = 0; i < a.length; i++) {
// statements
}
- Nested for Loop in one Line
for: (let i in range(1, 3)), (let j in range(1, 10)) {
print("$i X $j = ${i * j}")
}
This code is same to below code.
for: (let i in range(1, 3)) {
for: (let j in range(1, 10)) {
print("$i X $j = ${i * j}")
}
}
- Nested while Loop in one Line
while: (!a.isEmpty()), (a.value != 0) {
// statements
}
This code is same to below code.
while: (!a.isEmpty()) {
while: (a.value != 0) {
// statements
}
}