in reply to Boolean counter?
Two more approaches:
- Using hashes:
my %Next = ( 0 => 1, 1 => 0); my $Counter = 0; #... $Counter = $Next{$Counter};
- Decreasing instead of increasing:
$Counter = abs --$Counter;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Boolean counter?
by shawnhcorey (Friar) on Dec 07, 2009 at 14:07 UTC | |
by ikegami (Patriarch) on Dec 07, 2009 at 17:08 UTC | |
by JavaFan (Canon) on Dec 07, 2009 at 15:13 UTC | |
by Anonymous Monk on Dec 07, 2009 at 16:15 UTC | |
by ikegami (Patriarch) on Dec 07, 2009 at 17:01 UTC | |
by ikegami (Patriarch) on Dec 07, 2009 at 16:09 UTC | |
by ikegami (Patriarch) on Dec 07, 2009 at 16:57 UTC | |
by JavaFan (Canon) on Dec 07, 2009 at 21:55 UTC | |
|