I am making a trivia script. The hard part is the sorting and listing from a text file which contain user scores/point. If I have a file called score.txt which contain all the user's point from /write command like this:
Code:
99
35
67
1
33
11
33
33
144
3

How is it possible I can sort and list all this random numbers? What I did so far is getting the max value confused ,
Code:
 
 :max
  var %_min 1
  var %_max $lines(quiz\score.txt)
  var %_max_val 1
  while (%_min <= %_max) {
    set %_comparison $read(quiz\score.txt, t, %_min)
    if (%_comparison > %_max_val) var %_max_val %_comparison 
    inc %_min
  }
  return %_max_val
  halt


Last edited by sunsuron; 10/09/03 11:31 PM.