I want to build a rule that can get executed multiple times, has different output each time until it outputs nothing.
So basically what I want is random output without the random :D
u: (test) ^keep()
[ This should be the first ]
[This is the second output]
[ this is the third output]
By executing this rule the statement get of course printed in a random order.
I want to achieve them being in order without writing ugly and unclear code.
My current solution is using a trigger variable for that, but I would like to have a clearer way just like the random notation or something nearer:
if($trigger == null)
This should be the first
$trigger = 1
else if($trigger == 1)
This is the second output
$trigger = 2
else if($trigger == 2)
this is the third output
$trigger = 3
Apart from that is does everything I need:
- Output the three statements in order
- easily extensible (usable for n statements)
- Outputs nothing after all statements are used.