shantismurf

joined 2 years ago
[โ€“] [email protected] 3 points 2 years ago* (last edited 2 years ago)

Resolved!

From Discord:

BluePower โ€” Today at 11:49 AM

If you were to put the code in the list panel, try this:

travelarray = [['airport','train station','bus stop']]

It is basically an array inside of the square brackets, if you wrap any value (including functions) with them it'll be directly assigned into that variable

 

I'm trying to use the probability evaluation to look for a value in an array and only select that item if the value is found. I'm running into an issue creating the variable of the array.

['airport','train station','bus stop'].indexOf('airport') 

returns a positive 1 but

travelarray = ['airport','train station','bus stop']
travelarray.indexOf('airport') 

returns -1

Ultimately, I'd have a list like this:

situation 
  generic situation
  something that applies to airport location^[travelarray.indexOf(location) >= 0 ? 100 : 0]
  something that applies to bus station location^[travelarray.indexOf(location) >= 0 ? 100 : 0]

So, first, how do I create a variable array in perchance?

Second, is my if statement for the probability evaluation correct? There will be multiple items that fit each location, and I want generic situations to also be eligible regardless of location.

Thanks!