File: utils

package info (click to toggle)
algotutor 0.8.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 576 kB
  • sloc: perl: 2,563; makefile: 41; php: 24; sh: 1
file content (14 lines) | stat: -rw-r--r-- 219 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# vim: syntax=perl

use strict;
sub pick_extreme {
    my ($dir, @P) = @_;
    my ($ext, $i) = (0);
    for ($i=1; $i<=$#P; ++$i) {
	$ext = $i if ($dir->dot($P[$i]) > $dir->dot($P[$ext]));
    }
    return $ext;
}

1;