simon says, don't use uzi's??

May 15, 2007 at 2:32pm

simon says, don't use uzi's??

Hi,
I am making a simonsays style game for dancepads (long story)
I have this patch in wich a random list is created and then you have to mimic the list by pressing buttons, when the right amount of buttons are pressed the second list is checked with the first by using an uzi object and som zl stuff. The problem is that the uzi doesn’t do it, if you bang it 5 times under the uzi object it does work. Anyone know why?

best Pieter

here is the patch:
max v2;
#N vpatcher 9 44 1061 796;
#P origin 0 13;
#P window setfont “Sans Serif” 9.;
#P newex 275 137 50 196617 print;
#P newex 567 190 71 196617 loadbang;
#B color 6;
#P message 553 218 50 196617 5;
#P number 273 106 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 428 426 88 196617 moveto;
#P message 876 463 58 196617 reset;
#P flonum 816 446 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 220 32 50 196617 delay 250;
#P number 553 245 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 402 241 32 196617 zl len;
#B color 5;
#P newex 450 269 113 196617 if $i1 == $i2 then bang;
#P flonum 663 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 626 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 589 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 589 466 85 196617 pak 0. 0. 0.;
#P flonum 779 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 742 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 705 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 705 466 85 196617 pak 0. 0. 0.;
#P message 705 496 88 196617 glcolor $1 $2 $3;
#P message 589 496 88 196617 moveto $1 $2 $3;
#P message 816 463 58 196617 sphere $1;
#P window linecount 2;
#P newex 589 568 147 196617 jit.gl.sketch sample @lighting_enable 1;
#B color 5;
#P window linecount 1;
#P message 902 312 78 196617 reset;
#P newex 452 513 50 196617 jit.lcd;
#P toggle 821 291 15 0;
#P message 821 312 78 196617 auto_rotate $1;
#P newex 821 330 199 196617 jit.gl.handle sample @inherit_transform 1;
#P flonum 702 310 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 702 330 115 196617 erase_color 0. 0. 0. $1;
#P window linecount 2;
#N vpatcher 20 74 620 474;
#P window setfont “Sans Serif” 9.;
#P newex 50 92 47 196617 s draw2;
#P newex 68 72 41 196617 s draw;
#P newex 86 50 43 196617 s erase;
#P inlet 86 30 15 0;
#P inlet 68 52 15 0;
#P inlet 50 72 15 0;
#P connect 0 0 5 0;
#P connect 1 0 4 0;
#P connect 2 0 3 0;
#P pop;
#P newobj 641 263 46 196617 p drawers;
#P window linecount 1;
#P newex 622 377 185 196617 jit.window sample @floating 1 @fsaa 1;
#P newex 652 330 46 196617 r erase;
#P newex 623 356 256 196617 jit.gl.render sample @erase_color 0. 0. 0. 1. @ortho 1;
#P newex 623 218 57 196617 qmetro 33;
#P newex 623 240 66 196617 t b b b erase;
#P toggle 623 190 15 0;
#P message 236 172 50 196617 0;
#P newex 237 82 34 196617 + 1;
#B color 2;
#P newex 271 439 71 196617 loadbang;
#B color 6;
#P message 257 467 50 196617 5;
#P button 220 83 15 0;
#P newex 220 105 50 196617 uzi 6;
#P window linecount 2;
#P message 535 81 194 196617 check two list results in 1 if both are same else O;
#B color 6;
#P window linecount 1;
#P message 535 64 194 196617 reset line;
#B color 5;
#P message 535 47 194 196617 sets amount of inputs in group: difficulty;
#B color 2;
#P number 38 26 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 174 538 15 0;
#P number 257 488 35 9 0 0 0 3 0 0 0 40 204 140 222 222 222 0 0 0;
#P newex 174 512 123 196617 if $i1==$i2 then 1 else 0;
#B color 6;
#P newex 264 227 116 196617 if $i1==0 then $i1;
#B color 5;
#P number 174 488 35 9 0 0 0 3 0 0 0 40 204 140 222 222 222 0 0 0;
#P message 247 439 14 196617 0;
#B color 5;
#P newex 174 439 71 196617 gate;
#B color 6;
#N counter 0 0 5;
#X flags 0 0;
#P newobj 174 463 71 196617 counter 0 0 5;
#B color 6;
#P button 174 415 15 6;
#P toggle 192 415 15 0;
#P newex 192 376 55 196617 ==;
#P button 139 83 15 0;
#P newex 139 105 50 196617 uzi 5;
#P button 237 315 15 0;
#P number 237 295 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 237 259 72 196617 zl nth;
#P newex 385 269 62 196617 prepend set;
#P window setfont “Sans Serif” 20.;
#P message 385 342 210 196628 7 6 6 6 6;
#P window setfont “Sans Serif” 9.;
#P newex 385 218 50 196617 zl group 5;
#P window setfont “Sans Serif” 20.;
#P message 479 147 22 196628 7;
#P message 439 147 22 196628 6;
#P message 399 147 22 196628 5;
#P message 479 102 22 196628 4;
#P message 439 102 22 196628 X;
#P message 399 102 22 196628 3;
#P message 479 55 22 196628 2;
#P message 439 55 22 196628 1;
#P message 399 55 22 196628 0;
#P button 192 315 15 0;
#P button 202 227 15 0;
#P window setfont “Sans Serif” 9.;
#P number 192 295 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 220 172 15 0;
#N counter 0 0 5;
#X flags 0 0;
#P newobj 220 202 71 196617 counter 0 0 5;
#P number 220 227 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 158 259 72 196617 zl nth;
#P newex 48 269 62 196617 prepend set;
#P window setfont “Sans Serif” 20.;
#P message 48 342 210 196628 7 5 4 0 2;
#P button 139 147 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 139 172 50 196617 random 8;
#P newex 139 218 50 196617 zl group 5;
#P fasten 0 0 4 0 144 252 53 252;
#P connect 4 0 3 0;
#P connect 28 0 27 0;
#P connect 27 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 0 0;
#P fasten 10 0 5 0 207 250 163 250;
#P fasten 0 0 5 0 144 247 163 247;
#P fasten 29 0 31 0 197 404 179 404;
#P lcolor 7;
#P fasten 30 0 33 0 197 434 179 434;
#P lcolor 7;
#P connect 33 0 32 0;
#P lcolor 7;
#P connect 32 0 35 0;
#P lcolor 7;
#P connect 35 0 37 0;
#P lcolor 7;
#P connect 37 0 39 0;
#P lcolor 7;
#P fasten 40 0 27 1 43 73 184 73;
#P lcolor 3;
#P fasten 40 0 0 1 43 200 184 200;
#P lcolor 3;
#P fasten 5 0 9 0 163 285 197 285;
#P connect 9 0 11 0;
#P connect 9 0 29 0;
#P connect 29 0 30 0;
#P lcolor 7;
#P fasten 7 0 10 0 225 223 207 223;
#P fasten 34 0 32 3 252 458 224 458;
#P lcolor 7;
#P fasten 76 0 79 0 358 286 358 27 225 27;
#P connect 79 0 45 0;
#P connect 45 0 44 0;
#P connect 44 0 8 0;
#P connect 8 0 7 0;
#P connect 7 0 6 0;
#P connect 6 0 5 1;
#P fasten 40 0 32 4 43 252 239 252;
#P lcolor 3;
#P fasten 31 0 33 1 179 434 240 434;
#P lcolor 7;
#P fasten 28 0 49 0 144 135 241 135;
#P fasten 40 0 48 0 43 61 242 61;
#P lcolor 3;
#P fasten 21 0 24 0 390 247 242 247;
#P fasten 10 0 24 0 207 250 242 250;
#P connect 24 0 25 0;
#P connect 25 0 26 0;
#P connect 25 0 29 1;
#P fasten 36 0 34 0 269 341 252 341;
#P lcolor 6;
#P fasten 47 0 46 0 276 461 262 461;
#P fasten 40 0 38 0 43 487 262 487;
#P lcolor 3;
#P connect 46 0 38 0;
#P fasten 48 0 44 1 242 102 265 102;
#P lcolor 3;
#P fasten 7 0 36 0 225 223 269 223;
#P lcolor 6;
#P fasten 49 0 7 3 241 194 270 194;
#P fasten 48 0 83 0 242 102 278 102;
#P connect 44 0 86 0;
#P fasten 40 0 7 4 43 195 285 195;
#P lcolor 3;
#P fasten 38 0 37 1 262 507 292 507;
#P lcolor 7;
#P fasten 6 0 24 1 225 250 304 250;
#P fasten 20 0 21 0 484 187 390 187;
#P fasten 19 0 21 0 444 187 390 187;
#P fasten 18 0 21 0 404 187 390 187;
#P fasten 17 0 21 0 484 141 390 141;
#P fasten 15 0 21 0 404 141 390 141;
#P fasten 14 0 21 0 484 92 390 92;
#P fasten 13 0 21 0 444 92 390 92;
#P fasten 12 0 21 0 404 92 390 92;
#P fasten 21 0 23 0 390 252 390 252;
#P connect 23 0 22 0;
#P fasten 21 0 77 0 390 236 407 236;
#P fasten 40 0 21 1 43 196 430 196;
#P lcolor 3;
#P fasten 77 0 76 0 455 258;
#P fasten 85 0 84 0 572 212 558 212;
#P fasten 40 0 78 0 43 143 558 143;
#P lcolor 3;
#P connect 84 0 78 0;
#P connect 78 0 76 1;
#P connect 73 0 72 0;
#P connect 72 0 66 0;
#P fasten 81 0 64 0 881 523 594 523;
#P fasten 66 0 64 0 594 539 594 539;
#P fasten 67 0 64 0 710 539 594 539;
#P fasten 65 0 64 0 821 554 594 554;
#P connect 50 0 52 0;
#P connect 52 0 51 0;
#P connect 51 0 53 0;
#P fasten 54 0 53 0 657 351 628 351;
#P fasten 57 0 53 0 707 350 628 350;
#P fasten 59 0 53 0 826 351 628 351;
#P connect 74 0 72 1;
#P connect 51 1 56 0;
#P connect 51 2 56 1;
#P connect 75 0 72 2;
#P connect 51 3 56 2;
#P connect 58 0 57 0;
#P connect 69 0 68 0;
#P connect 68 0 67 0;
#P connect 70 0 68 1;
#P connect 71 0 68 2;
#P connect 80 0 65 0;
#P connect 61 0 60 0;
#P connect 60 0 59 0;
#P fasten 63 0 59 0 907 328 826 328;
#P pop;

#31927
May 15, 2007 at 4:00pm

I can not figure out how to make it work.
Please add comments that tell what one needs
to do to demontrate the problem.

#104256
May 15, 2007 at 4:32pm

Well, it seems overly complicated, no time to debug – sorry!
Pasted below is one way of doing it with jitter.

best,
nesa

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 427 494 100 196617 player and simon;
#P message 38 416 41 196617 dim $1;
#P toggle 277 556 15 0;
#P newex 277 533 34 196617 == 0.;
#P newex 247 510 55 196617 jit.3m;
#P newex 247 484 172 196617 jit.op @op absdiff @in2_name simon;
#P newex 247 451 128 196617 jit.matrix player 1 char 5;
#P newex 339 390 69 196617 jit.fill player;
#P newex 38 451 125 196617 jit.matrix simon 1 char 5;
#P newex 159 388 66 196617 jit.fill simon;
#P message 657 417 88 196617 moveto;
#P message 876 463 58 196617 reset;
#P flonum 816 446 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 276 421 50 196617 delay 250;
#P flonum 663 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 626 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 589 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 589 466 85 196617 pak 0. 0. 0.;
#P flonum 779 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 742 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 705 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 705 466 85 196617 pak 0. 0. 0.;
#P message 705 496 88 196617 glcolor $1 $2 $3;
#P message 589 496 88 196617 moveto $1 $2 $3;
#P message 816 463 58 196617 sphere $1;
#P window linecount 2;
#P newex 589 568 147 196617 jit.gl.sketch sample @lighting_enable 1;
#B color 5;
#P window linecount 1;
#P message 902 312 78 196617 reset;
#P newex 601 628 50 196617 jit.lcd;
#P toggle 821 291 15 0;
#P message 821 312 78 196617 auto_rotate $1;
#P newex 821 330 199 196617 jit.gl.handle sample @inherit_transform 1;
#P flonum 702 310 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 702 330 115 196617 erase_color 0. 0. 0. $1;
#P window linecount 2;
#N vpatcher 20 74 620 474;
#P window setfont “Sans Serif” 9.;
#P newex 50 92 47 196617 s draw2;
#P newex 68 72 41 196617 s draw;
#P newex 86 50 43 196617 s erase;
#P inlet 86 30 15 0;
#P inlet 68 52 15 0;
#P inlet 50 72 15 0;
#P connect 0 0 5 0;
#P connect 1 0 4 0;
#P connect 2 0 3 0;
#P pop;
#P newobj 641 263 46 196617 p drawers;
#P window linecount 1;
#P newex 622 377 185 196617 jit.window sample @floating 1 @fsaa 1;
#P newex 652 330 46 196617 r erase;
#P newex 623 356 256 196617 jit.gl.render sample @erase_color 0. 0.
0. 1. @ortho 1;
#P newex 623 218 57 196617 qmetro 33;
#P newex 623 240 66 196617 t b b b erase;
#P toggle 623 190 15 0;
#P window linecount 2;
#P message 535 81 194 196617 check two list results in 1 if both are
same else O;
#B color 6;
#P window linecount 1;
#P message 535 64 194 196617 reset line;
#B color 5;
#P message 535 47 194 196617 sets amount of inputs in group: difficulty;
#B color 2;
#P number 38 26 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 139 83 15 0;
#P newex 139 105 50 196617 uzi 5;
#P newex 385 269 62 196617 prepend set;
#P window setfont “Sans Serif” 20.;
#P window linecount 0;
#P message 385 342 215 196628;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 385 218 50 196617 zl group 5;
#P window setfont “Sans Serif” 20.;
#P message 479 147 22 196628 7;
#P message 439 147 22 196628 6;
#P message 399 147 22 196628 5;
#P message 479 102 22 196628 4;
#P message 439 102 22 196628 X;
#P message 399 102 22 196628 3;
#P message 479 55 22 196628 2;
#P message 439 55 22 196628 1;
#P message 399 55 22 196628 0;
#P window setfont “Sans Serif” 9.;
#P newex 48 269 62 196617 prepend set;
#P window setfont “Sans Serif” 20.;
#P window linecount 0;
#P message 48 342 203 196628;
#P button 139 147 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 139 172 50 196617 random 8;
#P newex 139 218 50 196617 zl group 5;
#P comment 426 481 100 196617 difference between;
#P comment 317 535 167 196617 check if there is any difference;
#P user panel 27 380 456 219;
#X brgb 214 208 167;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 7 0 6 0;
#P connect 20 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 3 0;
#P connect 21 0 20 0;
#P fasten 16 0 17 0 484 187 390 187;
#P fasten 15 0 17 0 444 187 390 187;
#P fasten 14 0 17 0 404 187 390 187;
#P fasten 13 0 17 0 484 141 390 141;
#P fasten 11 0 17 0 404 141 390 141;
#P fasten 10 0 17 0 484 92 390 92;
#P fasten 9 0 17 0 444 92 390 92;
#P fasten 8 0 17 0 404 92 390 92;
#P connect 19 0 18 0;
#P connect 49 0 48 0;
#P connect 48 0 42 0;
#P fasten 54 0 40 0 881 523 594 523;
#P fasten 42 0 40 0 594 539 594 539;
#P fasten 43 0 40 0 710 539 594 539;
#P fasten 41 0 40 0 821 554 594 554;
#P connect 26 0 28 0;
#P connect 28 0 27 0;
#P connect 27 0 29 0;
#P fasten 30 0 29 0 657 351 628 351;
#P fasten 33 0 29 0 707 350 628 350;
#P fasten 35 0 29 0 826 351 628 351;
#P connect 50 0 48 1;
#P connect 27 1 32 0;
#P connect 27 2 32 1;
#P connect 51 0 48 2;
#P connect 27 3 32 2;
#P connect 34 0 33 0;
#P connect 45 0 44 0;
#P connect 44 0 43 0;
#P connect 46 0 44 1;
#P connect 47 0 44 2;
#P connect 53 0 41 0;
#P connect 37 0 36 0;
#P connect 36 0 35 0;
#P fasten 39 0 35 0 907 328 826 328;
#P connect 59 0 60 0;
#P connect 60 0 61 0;
#P connect 52 0 59 0;
#P connect 62 0 63 0;
#P connect 61 2 62 0;
#P connect 3 0 56 0;
#P fasten 3 0 7 0 144 252 53 252;
#P fasten 17 0 19 0 390 252 390 252;
#P connect 17 0 58 0;
#P connect 58 0 52 0;
#P fasten 22 0 17 1 43 196 430 196;
#P lcolor 3;
#P fasten 22 0 3 1 43 200 184 200;
#P lcolor 3;
#P fasten 22 0 20 1 43 73 184 73;
#P lcolor 3;
#P connect 22 0 64 0;
#P lcolor 3;
#P connect 64 0 59 0;
#P connect 64 0 57 0;
#P window clipboard copycount 66;

#104257
May 16, 2007 at 9:43am

pieter coussement schrieb:
> The problem is that the uzi doesn’t do it, if you bang it 5 times
> under the uzi object it does work. Anyone know why?

For me both works.

If you strip down the problem yourself, you’ll find it…
If you don’t, nobody will look at it…

The solution is obvious, its called debugging and needs usually more
time than creating the first version of your patch. But that is normal
and just part of YOUR work…

Don’t let yourself be discouraged, its still fine to ask… (after doing
your homework… ;-)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#104258

You must be logged in to reply to this topic.