Skip to content

ejjang2030/krills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

krills

Krills is Simple Programming Language.

Getting Started

git clone command

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.

Syntax

Variable Types

  1. Integer
  2. Boolean
  3. String
  4. Function
  5. Array
  6. HashMap

Variable Definition and Initialization

>> let n1 = 5;
>> let n2 = 10;
>> n1 + n2
15

Function Definition

let func1 = fun(x, y) {
    x + y;
  }

or

fun test(x) {
    return x;
}

function identifier must not contain numbers

Future Goals to Implementation

Loop

  1. Condition Loop
    while: a.next() { 
        // statements
    }
  1. for Loop
    for: (let i = 0; i < a.length; i++) {
        // statements 
    }
  1. 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}")
        }
    }
  1. 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
        }
    }

Releases

No releases published

Packages

No packages published

Languages