It's funny. I have been coding in one language or another since the early 80s, and it was only this year that I encountered Yet Another Way to write a flip-flop.
my $ff = 0; while( 1 ) { print $ff ? 'hee ' : 'haw ', "\n"; $ff = 1 - $ff; }
For some perverse reason this really appeals to me, although I refrain from using it in production code. It has a certain mathematical elegance.
In reply to Re: Re: Flip Flop IV
by grinder
in thread Flip Flop IV
by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |