ink
ink copied to clipboard
Or statement when testing a list?
I'm writing this for a murder mystery game: `{
- deductions ? (murder_victim_was_not_lady_duffy) && clues ? (jewellery_missing || sweet_christine): ~ clue_sets+=clue_set_true_murderer }`
But the || is not working. The error message I get is "Can not call use '?' operation on List and Int". How can I perform a function based one having at least one of an item in a list, but not necessarily having both the items in the list?
You combine list elements using + not ||, but that will test for “contains both”. To test “contains any of”, use intersection - List ^ OtherList gives the overlap, and if it’s not empty, then an overlap exists-- Jazz, in Three-Four Time: A Novel http://www.amazon.co.uk/dp/B004K1EYIE