2025-10-09 18:02:00 +08:00
|
|
|
|
using Convention.RScript;
|
|
|
|
|
using Flee.PublicTypes;
|
|
|
|
|
using System;
|
2025-06-13 10:52:21 +08:00
|
|
|
|
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2025-10-09 18:02:00 +08:00
|
|
|
|
RScriptEngine engine = new();
|
2025-10-10 11:04:43 +08:00
|
|
|
|
RScriptImportClass import = new()
|
|
|
|
|
{
|
|
|
|
|
typeof(Math)
|
|
|
|
|
};
|
2025-10-09 18:02:00 +08:00
|
|
|
|
var result = engine.Run(@"
|
2025-10-10 11:04:43 +08:00
|
|
|
|
double i;
|
|
|
|
|
i = 2.0;
|
2025-10-11 17:24:40 +08:00
|
|
|
|
label(test);
|
2025-10-10 11:04:43 +08:00
|
|
|
|
{
|
2025-10-10 18:01:38 +08:00
|
|
|
|
goto(true,func1);
|
|
|
|
|
goto(100>i,test);
|
|
|
|
|
}
|
|
|
|
|
double result;
|
|
|
|
|
result = i;
|
|
|
|
|
|
|
|
|
|
goto(true,end);
|
|
|
|
|
|
2025-10-11 17:24:40 +08:00
|
|
|
|
label(func1);
|
2025-10-10 18:01:38 +08:00
|
|
|
|
{
|
2025-10-10 11:04:43 +08:00
|
|
|
|
i = Pow(i,2.0);
|
|
|
|
|
}
|
2025-10-11 17:24:40 +08:00
|
|
|
|
back(true);
|
2025-10-10 18:01:38 +08:00
|
|
|
|
|
|
|
|
|
label(end);
|
2025-10-09 18:02:00 +08:00
|
|
|
|
", import);
|
|
|
|
|
Console.WriteLine($"Script executed successfully. Result: {result["result"].data}");
|
2025-06-13 10:52:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|