Skip to content

Commit

Permalink
refactor: added currying and checks for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostVaibhav committed Jun 28, 2024
1 parent f61bf19 commit 084c78a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Mages.Core/Runtime/Functions/StandardFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,9 @@ public static class StandardFunctions
/// <summary>
/// Contains the random integer function.
/// </summary>
public static readonly Function Randi = new(args => SimpleRandom.GetInteger((int)args[0]));
public static readonly Function Randi = new(args => Curry.MinOne(Randi, args) ??
If.Is<Double>(args, x => SimpleRandom.GetInteger((int)x)) ??
0);

/// <summary>
/// Contains the throw function.
Expand Down

0 comments on commit 084c78a

Please sign in to comment.