The main problem with randomness in TW is, that if it is a filer-operator, which it should be for origin usecases. A random number will be created everytime the tiddler is rendered.
So the output will be changed every time the tiddler will be opened. – So it depends if that is something
you want.
For this type the built-in JavaScript functions can be used.
If you still want randomness, but with a repeatable outcome, to allow re-rendering, we will need a “seed value”. This seed-value can be random and will be fed into a “pseudo random” generator which will create the same “random” numbers depending on the seed.
Since the seed-value itself is random in sum the whole thing is random, but is still called a “pseudo random” number generator. — Not sure if that makes sense 
If implemented in a naive way, the output will not be random at all. – Luckily there is an algorithm which we could use.
- It creates a seed, that technically will never repeat in a session
- We will get almost unlimited unique seeds (2.132 x 10468) before they repeat
- We will be able to create any amount of random numbers using a range eg: 10000
- So it will create numbers between 0 and 10000-1 → 0000 - 9999
- We can create as many as we want
The advantage of the seed-value is:
- It can be stored and shared
- So if you have one, which creates an interesting output from your “Burroughs Cut-up” texts you can easily share it with others
- The initial seed can be created with the TW startup actions and
- the seed can be stored in a temporary tiddler
- So users can decide if they want to keep them or not
Filter Operator
A new uheprng
filter operator could look like this:
uheprng
… Ultra-High Entropy Pseudo-Random Number Generator. (not my name
)
[uheprng[<range>],[<count>],[<seed>]]
eg:
[uheprng[10000],[20],[random string or tiddler title]]
Which may create 20 random numbers in the format of 0000 - 9999
Would this be something you thought about?
We will also need a <$uheprng
(action)-widget, which can expose the other API elements that are needed. The parameters are not clear atm.
There is no TW related code and no commitment
-m