How do you create an empty array at the start of a story?
I've been trying:
(set: $bag to (a:[]))
Which doesn't seem to work.
I want the array empty in the beginning so I can have the story print that the bag is empty if the length of the array is zero, but have it print the contents of the array if the array contains strings. In 1.4.2, I would use:
<<if $bag.length is 0>>The bag is empty.<<else>><<print $bag.join("\n");>><<endif>>
But "Harlowe-izing" it doesn't seem to work. Any thoughts on what I'm doing wrong?
Comments
(set: $basket to (a:[]) )
In the next passage:
(set: $basket to $basket + (a:"pasta"))
And finally in the last passage:
(print: "You put on the belt:
" +
$basket.join("\n"))
Clunky but works?