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