Sugarcube 2.36.1
Players enter a maze. Since I do not know what path they may take, I’m using array.pop() to print statements on every nth turn. The problem is, once the array is depleted, [undefined] is printed. The documentation indicates that is the expected behavior. I’m not sure how to stop printing once the array is empty. I have tried an IF condition, but [undefined] still prints. Any suggestions?
<<if $maze.turns lte 15>>
<<= $maze.stmt>>
<</if>>
Thank you in advance,
Deborah