On 2010-09-23 09:20, IOhannes m zmoelnig wrote:
> 
> i think the main problems come from people trying to implement C-like
> control flow in a dataflow language like Pd.
> even my implementation was only trying to reproduce the algorithm you
> wrote down, rather than trying to figure a Pd-way to implement pong.
> 

so i think that one is more Pd'ish.
it's not trying to mimick your algorithm but rather solve the original
problem.

this eventually leads to a slight difference in the output (your
implementation and mine are not fully compatible), as here the py
denotes the middle of the paddle rather than the lower edge.

for the sake of simplicity i used an abstraction.

masrt
IOhannes
#N canvas 789 122 450 570 10;
#X obj 104 51 inlet;
#X obj 104 128 list split 1;
#X obj 104 156 \$1 \$2;
#X obj 103 175 select 1 0;
#X obj 103 278 list append;
#X obj 104 72 t l l;
#X obj 192 248 list append;
#X obj 103 299 outlet;
#X obj 192 268 outlet reject;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 1 1 4 1;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 6 0;
#X connect 4 0 7 0;
#X connect 5 0 1 0;
#X connect 5 1 6 1;
#X connect 6 0 8 0;
#N canvas 178 0 828 611 10;
#X obj 150 447 t f;
#X obj 150 230 ifroute <= 0;
#X obj 150 468 outlet;
#X text 358 238 check y-boundaries;
#X text 189 169 check x-boundaries;
#X obj 508 296 -;
#X obj 508 317 abs;
#X obj 508 338 < 30;
#X text 655 325 check paddle;
#X obj 230 230 ifroute < 500;
#X obj 50 54 inlet bx by py;
#X msg 50 175 2 bounce right;
#X msg 150 261 4 bounce bottom;
#X msg 305 261 5 bounce top;
#X msg 508 359 \$1 hit/miss paddle;
#X obj 50 147 ifroute >= 415;
#X obj 150 147 ifroute > 20;
#X obj 508 147 ifroute > 0;
#X connect 0 0 2 0;
#X connect 1 0 12 0;
#X connect 1 1 9 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 14 0;
#X connect 9 1 13 0;
#X connect 10 0 15 0;
#X connect 11 0 0 0;
#X connect 12 0 0 0;
#X connect 13 0 0 0;
#X connect 14 0 0 0;
#X connect 15 0 11 0;
#X connect 15 1 16 0;
#X connect 16 0 1 0;
#X connect 16 1 17 0;
#X connect 17 0 5 0;

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to