Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 560 Bytes

README.md

File metadata and controls

43 lines (32 loc) · 560 Bytes

interpreter

A test interpreter, made for learning purposes

Try the interpreter for yourself

git clone https://github.com/jhm-ciberman/interpreter
cd interpreter
npm install
npm link

Then navigate to any directory and create a new file:

// main.ciber
/*
Program that calculates factorial of N 
*/

var product = 1;
var j = 1;
var N = 10;

while ( j <= N ) { // iterative
  product = product * j;
  j = j + 1;
}

product;

And run it with:

ciber main.ciber

The output will be the factorial of 10:

3628800