Hubert, Thanks for sharing !
Tony On Thursday, 23 April 2020 22:24:22 UTC+10, Hubert wrote: > > OK, I've written this quick and dirty one-liner JavaScript macro that > takes two arguments: min and max (ideally integers; any floats are floored > down on output). Input arguments (min and max) are included in the random > output. > > Shorthand syntax below. In this example the macro will output an integer > between 10 and 30 (inclusive). > > <<Random 10 30>> > > File attached if anyone finds it useful. > > Regards, > Hubert > > On Thursday, 23 April 2020 13:11:18 UTC+1, Hubert wrote: >> >> Hi Tony, >> >> Also using now to return the milliseconds may be quite helpful >>> >>> <<now "0XXX">> >>> >> >> Wow, that's very creative! Thank you. Through some further tweaking of >> that we might even be able to define the min and max integers for the >> random range as well. >> >> That could be useful - however I thing some of the maths plugins include >>> this eg evans formula plugin. >>> >> >> Yes, Evan's formula has been my go-to maths plugin for years, also for >> random. >> >> Thanks again, >> Hubert >> >> >> On Thursday, 23 April 2020 13:06:16 UTC+1, TonyM wrote: >>> >>> Hubert, >>> >>> That could be useful - however I thing some of the maths plugins include >>> this eg evans formula plugin. >>> >>> Also using now to return the milliseconds may be quite helpful >>> >>> <<now "0XXX">> >>> >>> However just for one shot, not in a list. >>> >>> Regards >>> Tony >>> >>> On Thursday, April 23, 2020 at 9:52:20 PM UTC+10, Hubert wrote: >>>> >>>> Hello, >>>> >>>> It appears that Mathematics Operators >>>> <https://tiddlywiki.com/prerelease/static/Mathematics%2520Operators.html> >>>> don't currently include a random operator. >>>> >>>> I know this feature can be easily written as a macro with just a few >>>> lines of js or, otherwise, the fomula plugin already ships with random >>>> out of the box. >>>> >>>> However, I think it would be a great to have the random operator in >>>> the core, just like the range >>>> <https://tiddlywiki.com/#range%20Operator> operator was added not so >>>> long ago. >>>> >>>> Just some thoughts. >>>> >>>> Regards, >>>> Hubert >>>> >>>> >>>> >>>> -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/006916c1-7873-4933-b8ae-715f6259e8a0%40googlegroups.com.

