in reply to Re^5: Golf: Tree searching
in thread Golf: Tree searching
A tip. Whenever possible go for the one-line looping
constructs. The following two are equivalent logically:
however the second has 3 characters you may be able to drop. So use it. Even if it means using commas etc in C to get it to work, use it. (I am able to drop the 2 spaces.) A technicality, to be sure, but a significant one.for(A;B;C){} A;C while B;
Also while the binding of and can make it better than &&, if you see it used that way, look for a way to move things around to get the && in somewhere and save a character. Watch:
Not something you would write from scratch, but there you have it...sub f { $t=pop;$t=$$t{$c>0?l:r}while$c=$t&&$$t{d}cmp$_[0];$t }
In Section
Meditations