// Example using Rillium.Script to parse a script and math expressions.
// https://github.com/rilliumio/Rillium.Script
using System;
using Rillium.Script;
public class Program
{
public static void Main()
// Evaluate the script and specify the desired return type (in this case int)
int x = Evaluator.Evaluate<int>("var x = 1; return x;");
Console.WriteLine(x);
// When the return is omitted the last expression evaluated is returned;
int y = Evaluator.Evaluate<int>("var x = 1; x;");
Console.WriteLine(y);
// Another example of an implied return;
double z = Evaluator.Evaluate<double>("1.5 * 2.0 + 3.0 / 2.0");
Console.WriteLine(z);
}