Hi everyone,
I'm working in Harlowe Twine 2.0.
I am creating an in-game vocabulary assessment that tests players as they progress through the game. I have an array $questCompleted1 which includes a list of datamap variables $vocab1, $vocab2, $vocab3. I am using the array $vocabAssessment to add arrays from completed quests to another array so that I can randomly select a vocab variable to test the players based on completed quests. Now I would like that as players complete additional quests I could add an array from other quests to the array $vocabAssessment. So something like, the following: (set: $vocabAssessment to it + $completedQuest2) where $completedQuest2 is equal to ($vocab3, $vocab4, $vocab5). The issue is that now $vocabAssessment contains $vocab1, $vocab2, $vocab3, $vocab3, $vocab4, $vocab5)... $vocab3 is produced twice. Is there a way to remove duplicates in an array?
I'm working in Harlowe Twine 2.0.
I am creating an in-game vocabulary assessment that tests players as they progress through the game. I have an array $questCompleted1 which includes a list of datamap variables $vocab1, $vocab2, $vocab3. I am using the array $vocabAssessment to add arrays from completed quests to another array so that I can randomly select a vocab variable to test the players based on completed quests. Now I would like that as players complete additional quests I could add an array from other quests to the array $vocabAssessment. So something like, the following: (set: $vocabAssessment to it + $completedQuest2) where $completedQuest2 is equal to ($vocab3, $vocab4, $vocab5). The issue is that now $vocabAssessment contains $vocab1, $vocab2, $vocab3, $vocab3, $vocab4, $vocab5)... $vocab3 is produced twice. Is there a way to remove duplicates in an array?