added reset_seed

This commit is contained in:
gnembon committed 2021-03-12 06:11:55 -04:00
1 parent ece43b6213
commit eab24f7896
6 files changed
+21 -2

No files matched your search

@@ -210,6 +210,10 @@ public class Sys {
Value retval = new NumericValue(NumericValue.asNumber(argument).getDouble()*randomizer.nextDouble());
return (cc, tt) -> retval;
});
expression.addLazyFunction("reset_seed", 1, (c, t, lv) -> {
boolean gotIt = c.host.resetRandom(NumericValue.asNumber(lv.get(0).evalValue(c)).getLong());
return gotIt?LazyValue.TRUE:LazyValue.FALSE;
});
expression.addLazyFunction("perlin", -1, (c, t, lv) ->
{