private static bool Number(Interpreter interpreter, Source source, Stringe tagName, TagArg[] args) { int a, b; if (!Int32.TryParse(args[0].GetString(), out a) || !Int32.TryParse(args[1].GetString(), out b)) { throw new ProcessusException(source, tagName, "Range values could not be parsed. They must be numbers."); } interpreter.Print(interpreter.FormatNumber(interpreter.RNG.Next(a, b + 1))); return false; }
private static bool RepNum(Interpreter interpreter, Source source, Stringe tagname, TagArg[] args) { if (interpreter.CurrentRepeater == null) throw new ProcessusException(source, tagname, "No active repeaters."); interpreter.Print(interpreter.FormatNumber(interpreter.CurrentRepeater.Index + 1)); return false; }