new-words

diff new-words.sh @ 19:416394a87d9f

minifix
author Igor Chubin <igor@chub.in>
date Tue Apr 20 21:15:19 2010 +0400 (2010-04-20)
parents 7e3a52db54ad
children 23f949c03f95
line diff
     1.1 --- a/new-words.sh	Mon Apr 05 21:34:55 2010 +0300
     1.2 +++ b/new-words.sh	Tue Apr 20 21:15:19 2010 +0400
     1.3 @@ -95,13 +95,15 @@
     1.4  my $total_known=shift(@ARGV);
     1.5  my $s=0;
     1.6  my $mark_line=int($total_known*100/$total/5)*5;
     1.7 -if ($mark_line>=90) { $mark_line+=1; } else { $mark_line +=5; };
     1.8 +if ($mark_line>=90) { 
     1.9 +    $mark_line=int($total_known*100/$total)+1;
    1.10 +} else { $mark_line +=5; };
    1.11  while(<>)
    1.12  {
    1.13      print;
    1.14      /^\s*([0-9]*)\s*/;
    1.15      $s+=$1;
    1.16 -    if (int(($total_known+$s)*100/$total)>=$mark_line) {
    1.17 +    if (($total_known+$s)*100/$total>=$mark_line) {
    1.18          print "# $mark_line\n";
    1.19          if ($mark_line>=90) { $mark_line+=1; } else { $mark_line +=5; };
    1.20      }