Using Randomness in TiddlyWiki

Folks,

There exists a few random tiddler selection tools in tiddlywiki including those below.

However I was under the impression there was a way to generate a random number of arbitrary size, ideally with a seed for “extra shiny randomness”.

As a result of seeing Mat’s simple random filter below uses <<now 0XXX>> the microseconds I realise the random value I need can come from both now and the 5.1.23 Release Startup time stamp and should be enough, and being time keyed also has its value. Since todays date/time and millisecond is unlikely to reoccur.

Thanks @SonephetR2

When I have a random number generator I will turn this into a “How to”.

The Shuffle Operator comes close
https://mklauber.github.io/tw5-plugins/#Shuffle%20Operator

And Tobiases random operator selects tiddlers
https://tobibeer.github.io/tw5-plugins/#random

Mat’s simple random filter (see Scripts in Tiddlywiki — codes, macros, and solutions in TW, or the original GG conversation.

1 Like

There’s also Mat’s simple random filter (see Scripts in Tiddlywiki — codes, macros, and solutions in TW, or the original GG conversation.

1 Like

I have a couple of questions related to these plugins. Didn’t know where else to post them.

For Tobias’ random operator, I couldn’t figure out how to get a line break in between the results of a reference like “[tag[Plugins]random[3]]”. Ideally, I might even want to handle each result in a $list with random[] used in the filter. Is there any way to do this?

Maybe the last question doesn’t matter that much because I pretty much got what I wanted using Matt’s shuffle operator, which I found because of your post. I was trying to make a really small tweak with his example that uses an “Update” button. All I wanted to do was put the button after the list, but doing that causes the list to shuffle whenever any action is taken in the TiddlyWiki. Is there a way to compute a value for the shuffle state field before the $list so that I can have the initial shuffle results stick until I push the button?

One thing I did try was to store the state field value in the same tiddler where the $list and the Update button are displayed. This works fine except that the results are preserved even when the tiddler or the wiki are closed and reopened. I’d rather have a new set of results computed every time the tiddler is opened.

Thanks!
Todd

[tw5] Coding fun: random sort

You might also want to look at
https://yaisog.tiddlyhost.com/#$:/plugins/yaisog/random-filter
and
https://yaisog.tiddlyhost.com/#$:/plugins/yaisog/choose-random-filter

Have a nice day
Yaisog

1 Like