[PD] jMax Phoenix

IOhannes m zmoelnig zmoelnig at iem.at
Wed Sep 22 18:36:03 CEST 2010


On 2010-09-22 16:48, Jonathan Wilkes wrote:
> 
> 
> expr if(bx<=20, if (py<=by && py+60>=by, 0, 1), -1);
> if (bx>=415, 2, -1);
> if (by<=0, 4, if (by>=500, 5, -1))
> 

honestly i find this hard to read as well, esp. compared to traditional
C-like syntax:

if(bx<=20)
  if(py<=by && py+60>=by)
    return 0;
  else
    return 1;
if(by>=415)
 return 2;
else
 return -1;
if(by<=0)
 return 4;
else if (by>=500)
 return 5;


and as a matter of fact, i don't think the pd-implementation of the
algorithm is so bad.
the only awkwardness in my implementation i find is the
 [*-1]->[moses 0]
, which one could simply replace by [moses -1] (supposed we don't care
about values between -1 and 0) (or with a [<=0]->[select 1] which i
didn't do for conceptual reasons)

fgmasdr
IOhannes
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pong.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100922/790c0638/attachment.asc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100922/790c0638/attachment.bin>


More information about the Pd-list mailing list