From: Steinar H. Gunderson Date: Sun, 25 Mar 2012 15:25:58 +0000 (+0200) Subject: Factor out the parameter saving into its own function. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9ac6ff06f2fc46865b190a0ff6c14ac68516c4da;p=wloh Factor out the parameter saving into its own function. --- diff --git a/www/index.pl b/www/index.pl index ec6428c..0ce8cc6 100755 --- a/www/index.pl +++ b/www/index.pl @@ -136,15 +136,8 @@ sub get_covariance_matrix { return $cov; } -sub make_table { - my ($lowest_division, $used_ratings, $used_cov) = @_; - - print <<"EOF"; - - - - -EOF +sub write_parms_to_file { + my ($used_ratings, $used_cov) = @_; POSIX::setlocale(&POSIX::LC_ALL, 'C'); @@ -179,6 +172,20 @@ EOF POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8'); + return $tmpnam; +} + +sub make_table { + my ($lowest_division, $used_ratings, $used_cov) = @_; + + print <<"EOF"; + +
+ + +EOF + + my $tmpnam = write_parms_to_file($used_ratings, $used_cov); my %prob = (); open MCCALC, "$config::base_dir/mcwordfeud $trials < $tmpnam |"