Hi again.
I have a task list sorted by priority. Each task has a priority 1-100. Something like this:
<$list filter="[tag[task]!nsort[priority]]">
{{!!title}} (priority: {{!!priority}})
<br>
</$list>
I’m trying to add some “fuzz” to the sort order to avoid to avoid tasks with the same priority value always clustering together. In other words I want to sort tasks by their priority +/- some random integer between 0 and 5 (or something like that). Using the shuffle operator plugin I’ve ended up with this:
\procedure order() [get[priority]add<fuzz>]
\function fuzz() [range[-5],[5]shuffle[]first[]]
<$list filter="[tag[task]!sortsub:number<order>]">
{{!!title}} (priority: {{!!priority}})
<br>
</$list>
Works great, except that <<fuzz>>
refreshes on every button click, so the list is constantly reshuffling. What I want is to apply the fuzz only once when the tiddler containing the list is first opened.
I’m pretty stuck as to how I could approach this. Can anyone help?