Two more approaches:
- Using hashes:
my %Next = ( 0 => 1, 1 => 0); my $Counter = 0; #... $Counter = $Next{$Counter};
- Decreasing instead of increasing:
$Counter = abs --$Counter;
In reply to Re: Boolean counter?
by vitoco
in thread Boolean counter?
by DreamT
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |