fork download
  1. Elsa = "Elsa"
  2.  
  3. Anna = "Anna"
  4.  
  5. Characters = {}
  6.  
  7. Characters[Anna] = 1
  8.  
  9. Characters[Elsa] = 2
  10.  
  11. CharList = {"Anna", "Elsa"}
  12.  
  13. ovar = 0
  14.  
  15. Worst = 0 --Anna's not bad, but of the list she is the worst.
  16.  
  17. for i = 1, #CharList do
  18.  
  19. if Characters[CharList[i]] >= ovar +1 then --I can't remember if this works
  20.  
  21. ovar = Characters[CharList[i]]
  22.  
  23. Best = CharList[i]
  24.  
  25. elseif Characters[CharList[i]] <= Worst then
  26.  
  27. WorstChar = CharList[i]
  28.  
  29. Worst = Characters[Charlist[i]]
  30.  
  31. end
  32.  
  33. end
  34.  
  35. print(Best .. " > " .. Worst) --I hope this works.
Success #stdin #stdout 0.01s 2540KB
stdin
Standard input is empty
stdout
Elsa > 0