swap two elements of an array
@array[$index1, $index2] = @array[$index2, $index1];
step $index in direction $dir (+1 or -1) in array in a 'circular' way:
$index = ($index + $dir) % @array; print $array[$index];
In reply to Re: Array manipulation how to
by moritz
in thread Array manipulation how to
by chessgui
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |