Tinderbox Forum

Random Sorting in Outline


(Dirk Kalmbach) #1

Hi All,

is there a possibility to sort the notes within an Agent randomly? And if yes, can I do this regularly (e.g. within specific time intervals or with every opening of TBX?

Thanks
Dirk


(Mark Anderson) #2

There is no random sort setting. You might do something by using rand() to seed a Number type attribute with a value and sort on that. How often does this sort need to occur? Every agent cycle?

Also if you want a random pick of an item in the container look at the randomChild designator.


(Dirk Kalmbach) #3

randomChild would be appropriate for me - I wasn’t aware of this designator. Thanks for the tip, Mark.
Btw: on which coding language is TBX build on? I often struggle with the correct syntax - maybe knowing this would help me …


(Mark Anderson) #4

I don’t think it’s built on any particular language. Indeed, trying to think of it like a programming language probably just confuses. It is the result of some 18 years of incremental growth of what were originally a few internal macros.


(eastgate) #5

Tinderbox is written in C++ and Objective C.

The Tinderbox action language is hand-designed. It’s influenced by C, Lisp/FORTH, and by various other little languages. Despite appearances, it’s a very small and simple language.

There’s a nice list of designators in the Help chapter on actions.