I want to use C# to build a custom-made scripting language. It will have simple statements which are in fact method calls with arguments like:
Set("C1", 63);
Wait(1.5);
Incr("C1", 1);
Now, I want to provide also a loop and the usual C# syntax with the indexer is too complicated for such a simple thing. For example I would have this to loop 20 times:
for (20)
{
Wait(1.5);
Incr("C1", 1);
}
Is there some way to achieve such a simple loop at least closely? (e.g. a wrapped method call inside the for statement or the like)
Thanks, Marcel
create a function extending ints:
call it like: