All pastes #104804 Raw Edit

Anonymous

public text v1 · immutable
#104804 ·published 2006-07-29 07:19 UTC
rendered paste body
alias trivhs {
  var %i = 0
  var %z = 0
  var %a = 0
  while (%z < $hget(trivscores,0).item) { 
    inc %z 1   
    var %totals = $iif(%totals != $null,%totals $+ $chr(44)) $+ $hget(trivscores,%z).item $+ ; $+ $hget(trivscores,$hget(trivscores,%z).item)
  }
  while (%a < $1) {
    inc %a 1
    while (%i < $hget(trivscores,0).item) {
      inc %i 1
      if (%highs == $null) {
        var %highs = $gettok(%totals,%i,44)
      }
      elseif ($gettok($gettok(%totals,%i,44),2,59) > $gettok(%highs,2,59)) {
        var %highs = $gettok(%totals,%i,44)
      }
    }
    var %totals = $remove(%totals,%highs $+ $chr(44))
    var %ahighs = $iif(%ahighs != $null,%ahighs $+ $chr(44)) $+ %highs
  }
  return %ahighs // %totals
}