1.0.5 ā€¢ Published 2 years ago

argee v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago