ink icon indicating copy to clipboard operation
ink copied to clipboard

Or statement when testing a list?

Open lulamorashi opened this issue 4 years ago • 1 comments

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?

lulamorashi avatar Aug 26 '20 04:08 lulamorashi

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

joningold avatar Sep 02 '20 07:09 joningold