Start of layout
Set "lastDirectionPicked" to "0"
do you trigger condition
set "chooseDirection" to "0,90,180,270"
(reset all possible choices)
set "chooseDirection" to replace("chooseDirection", "lastDirectionPicked", "")
(remove the last direction from those choices)
set "directionMovement" to tokenat("chooseDirection", int(random(3)), ",")
(choose a direction from the ones left at random)
set "lastDirectionPicked" to "directionMovement"
(keep track of direction just taken)