simple list comparison

fhill2000's icon

How would i do this?
If int (x) is equal to an item of the list. Output (x).
If int (x) is not equal to an item of the list. Output (x)+1

It seems zl object doesn't have a mode that supports this??
Please save my headache!
Thanks!

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

this is all I could come up with-- it works but there may well be a 'cleverer' way:

ch's icon
Max Patch
Copy patch and select New From Clipboard in Max.

you can also use vexpr for that kind of thing :

broc's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Regarding the question "is x element of list?" I find [zl sub] well suited.

fhill2000's icon

Damn, 5 different ways to do this and I couldn't think of even one of them?
I think you can tell I am more of a musician then a programmer..
Thanks a lot for the help, 'brocs' example looks like the least long-winded. I will go with that one.