For example: 100 2 -2 44 150 9 26 -4 150 9 0 -1
I want to create a 2 dimensional array 361x361 and set it to zero then start recording the count of combination $a $b the combination of 150 and 9 appeared twice on the list so the count will be 2 can I do something like this ?
my @a = ((0) x 361); my @b = ((0) x 361); my @matrix = (@a,@b) while ($line = <IN>) { @record = split(/\s+/, $line); $a = $record[0]; $b = $record[1]; @matrix [$a+180][$b+180] ++; }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |