:: StoryTitle Arrays in Harlowe :: init [startup] (set: $inventory to (a:)) (set: $chest to (a: 'a shield', 'a suit of armor')) (set: $chestOpen to false) :: inventory [header] You are currently carrying: \ (if: $inventory's length is 0)[\ nothing. ](else:)[\ \ (for: each _item, ...$inventory)[\ _item (unless: $inventory's last is _item)[, ]\ ]. ] ----- :: Start \ You find yourself inside a small room. In the corner, you see a sword, and decide to pick it up. (set: $inventory to it + (a: 'a sword'))\ [[Continue|hallway]] :: hallway You see a chest here in the hallway. \ (unless: $chestOpen)[\ Do you want to open it? { (link: 'Open the chest.')[ (set: $inventory to it + $chest) (set: $chestOpen to true) (goto: 'chest') ] } ](else:)[\ It's open, and there's nothing inside. ]\ [[Move on.|dart trap]] :: chest You open the chest and find (for: each _item, ...$chest)[\ _item (unless: $chest's last is _item)[ and ]\ ]. (link: 'Okay')[ (goto: (history:)'s last) ] :: dart trap Several darts shoot out of a wall at you! (if: $inventory contains 'a shield')[\ Luckily, your shield will protect you. ](else:)[\ With no way to defend yourself, you die. ]