Better match object

Jan 19, 2013 at 1:41pm

Better match object

Dear Cycling forum people!

I’ve just finished a sweet project. It’s an interactive gaming table. It’s a digital version of Halli Galli ( a card game ). Some pictures are available on http://www.thomashuster.com/#!projecten/c1t44 ( sorry it’s not in english yet! ).

The entire game in run on 4 arduino’s and max msp. I got a small problem tho.

I’ve got 4 numbers that are variables for the lives of each player ( 4 players ). And when 3 of those players are “0″ the patch knows, there is a winner !! And the apropriate actions are made!

I’m using [ match 0 0 0 ] to check when 3 players have “0″, However this does not work very well!!
Sometimes when there are only 2 players left it already gives the a bang after [ match 0 0 0 ] Does anyone know a better object for this?

thanks in advance! much love, sorry for the bad english!

greetings!

#54420
Jan 19, 2013 at 3:06pm

Hi,

To find in a list if there is only one non-zero number, just compare those numbers to the sum.

Here an example that give you the index of the number as a bonus ;-)

– Pasted Max Patch, click to expand. –
#196019
Jan 19, 2013 at 3:40pm

Merci beaucoup monsieur Nicolas Danet!

That was exactly what i was looking for! I used [join 4] to put in a message and voila. It works like a charm!

thanks again!

Bonne journée!

#196020
Jan 19, 2013 at 4:19pm

you need to reset [match] with every new input or it might match 3 zeros as a combination of new/previous input.

#196021
Jan 19, 2013 at 4:36pm

yes, that seemed to be the problem. but the solution Nicolas gave me works great too.

thanks anyway tho

#196022

You must be logged in to reply to this topic.