Ejemplo n.º 1
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it using a custom RNG, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="rng">The random number generator to use when generating output.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <returns></returns>
 public Output Do(string input, RNG rng, int charLimit = 0)
 {
     return(new Interpreter(this, RantPattern.FromString(input), rng, charLimit).Run());
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <returns></returns>
 public Output Do(string input, int charLimit = 0)
 {
     return(new Interpreter(this, RantPattern.FromString(input), new RNG(Seeds.NextRaw()), charLimit).Run());
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it using a custom seed, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="seed">The seed to generate output with.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <returns></returns>
 public Output Do(string input, long seed, int charLimit = 0)
 {
     return(new Interpreter(this, RantPattern.FromString(input), new RNG(seed), charLimit).Run());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it using a custom RNG, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="rng">The random number generator to use when generating output.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <param name="timeout">The maximum number of seconds that the pattern will execute for.</param>
 /// <param name="args">The arguments to pass to the pattern.</param>
 /// <returns></returns>
 public RantOutput Do(string input, RNG rng, int charLimit = 0, double timeout = -1, RantPatternArgs args = null) =>
 RunVM(new Sandbox(this, RantPattern.FromString(input), rng, charLimit, args), timeout);
Ejemplo n.º 5
0
 /// <summary>
 /// Executes the specified pattern and returns a series of outputs.
 /// </summary>
 /// <param name="input">The pattern to execute.</param>
 /// <param name="rng">The random number generator to use when generating output.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <param name="timeout">The maximum number of seconds that the pattern will execute for.</param>
 /// <param name="args">The arguments to pass to the pattern.</param>
 /// <returns></returns>
 public IEnumerable <RantOutput> DoSerial(string input, RNG rng, int charLimit = 0, double timeout = -1, RantPatternArgs args = null) =>
 new Sandbox(this, RantPattern.FromString(input), rng, charLimit, args).RunSerial(timeout);
Ejemplo n.º 6
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <param name="timeout">The maximum number of seconds that the pattern will execute for.</param>
 /// <param name="args">The arguments to pass to the pattern.</param>
 /// <returns></returns>
 public RantOutput Do(string input, int charLimit = 0, double timeout = -1, RantPatternArgs args = null) =>
 RunVM(new Sandbox(this, RantPattern.FromString(input), new RNG(Seeds.NextRaw()), charLimit, args), timeout);
Ejemplo n.º 7
0
 public static Subroutine FromString(string name, string code, Tuple <string, ParamFlags>[] parameters)
 {
     return(new Subroutine(RantPattern.FromString(name, code), parameters));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it using a custom RNG, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="rng">The random number generator to use when generating output.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <param name="timeout">The maximum number of seconds that the pattern will execute for.</param>
 /// <returns></returns>
 public RantOutput Do(string input, RNG rng, int charLimit = 0, double timeout = -1)
 {
     return(RunVM(new VM(this, RantPattern.FromString(input), rng, charLimit), timeout));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it using a custom seed, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="seed">The seed to generate output with.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <param name="timeout">The maximum number of seconds that the pattern will execute for.</param>
 /// <returns></returns>
 public RantOutput Do(string input, long seed, int charLimit = 0, double timeout = -1)
 {
     return(RunVM(new VM(this, RantPattern.FromString(input), new RNG(seed), charLimit), timeout));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Compiles the specified string into a pattern, executes it, and returns the resulting output.
 /// </summary>
 /// <param name="input">The input string to execute.</param>
 /// <param name="charLimit">The maximum number of characters that can be printed. An exception will be thrown if the limit is exceeded. Set to zero or below for unlimited characters.</param>
 /// <param name="timeout">The maximum number of seconds that the pattern will execute for.</param>
 /// <returns></returns>
 public RantOutput Do(string input, int charLimit = 0, double timeout = -1)
 {
     return(RunVM(new VM(this, RantPattern.FromString(input), new RNG(Seeds.NextRaw()), charLimit), timeout));
 }