argee
v1.0.5
Published
<h1> π About the package π </h1> This is the official interpreter for the rg language. <br> Make sure to star the github repository!
Downloads
6
Maintainers
Readme
After installing, create a .env
file, and specify the path to your .rg file.
Your .env
file should have something similiar to:
FILE=./main.rg
Now let's code some RG! Here's an implementation of the classic fizzbuzz coding problem in rg:
i = 1
@for $i <= 100; i = $i + 1
state = ""
@if $i % 3 == 0 && $i % 5 == 0
print("FizzBuzz")
state = "yes"
@fi
@if $i % 3 == 0 && !$state
print("Fizz")
state = "yes"
@fi
@if $i % 5 == 0 && !$state
print("Buzz")
state = "yes"
@fi
@if !$state
print($i)
@fi
@rof
To get the value of a variable, write a dollar sign ($), then the name of the variable.
To run the file, run the following from the root of your project: node node_modules/argee/interpreter.js
- nested for loops and nested ifs are not supported.
- If you do write them, you will most likely receive an unexpected result, if not a compile error.
- There is no such thing as else or else-ifs, as rg encourages you to confidently state all possible conditions.
$ npm i argee