home *** CD-ROM | disk | FTP | other *** search
- on CompareHighScores TOF
- global TRAVEL, DAYS, AUKT_JOBS, RANS, WANS, CASH, TWNS, KARM, gPref_path
- if the machineType = 256 then
- openXLib(the pathName & "FILEIO.DLL")
- end if
- set fil to FileIO(mnew, "read", gPref_path)
- set W to EMPTY
- repeat with n = 1 to 500
- set W to W & fil(mReadLine)
- if W contains ".high scores" then
- exit repeat
- end if
- end repeat
- set HS to fil(mReadFile)
- set maxAukt to value(line 2 of HS)
- set maxTowns to value(line 4 of HS)
- set maxSolve to value(line 6 of HS)
- set minDays to value(line 8 of HS)
- set maxDays to value(line 10 of HS)
- set maxAssign to value(line 12 of HS)
- fil(mdispose)
- if TOF then
- repeat with n = 1 to 3
- if getAt(maxAukt, n) <> [] then
- if getAt(getAt(maxAukt, n), 1) <= count(AUKT_JOBS) then
- set maxAukt to SortHS(maxAukt, n, count(AUKT_JOBS))
- exit repeat
- end if
- next repeat
- end if
- set maxAukt to SortHS(maxAukt, n, count(AUKT_JOBS))
- exit repeat
- end repeat
- set numOfDiffTowns to countDiffTravels()
- repeat with n = 1 to 3
- if getAt(maxTowns, n) <> [] then
- if getAt(getAt(maxTowns, n), 1) <= numOfDiffTowns then
- set maxTowns to SortHS(maxTowns, n, numOfDiffTowns)
- exit repeat
- end if
- next repeat
- end if
- set maxTowns to SortHS(maxTowns, n, numOfDiffTowns)
- exit repeat
- end repeat
- repeat with n = 1 to 3
- if getAt(maxSolve, n) <> [] then
- if getAt(getAt(maxSolve, n), 1) < KARM then
- set maxSolve to SortHS(maxSolve, n, KARM)
- exit repeat
- end if
- next repeat
- end if
- set maxSolve to SortHS(maxSolve, n, KARM)
- exit repeat
- end repeat
- repeat with n = 1 to 3
- if getAt(minDays, n) <> [] then
- if getAt(getAt(minDays, n), 1) >= DAYS then
- set minDays to SortHS(minDays, n, DAYS)
- exit repeat
- end if
- next repeat
- end if
- set minDays to SortHS(minDays, n, DAYS)
- exit repeat
- end repeat
- repeat with n = 1 to 3
- if getAt(maxDays, n) <> [] then
- if getAt(getAt(maxDays, n), 1) <= DAYS then
- set maxDays to SortHS(maxDays, n, DAYS)
- exit repeat
- end if
- next repeat
- end if
- set maxDays to SortHS(maxDays, n, DAYS)
- exit repeat
- end repeat
- repeat with n = 1 to 3
- if getAt(maxAssign, n) <> [] then
- if getAt(getAt(maxAssign, n), 1) <= (RANS - WANS) then
- set maxAssign to SortHS(maxAssign, n, RANS - WANS)
- exit repeat
- end if
- next repeat
- end if
- set maxAssign to SortHS(maxAssign, n, RANS - WANS)
- exit repeat
- end repeat
- set fil to FileIO(mnew, "write", gPref_path)
- set W to W & ".max aukt" & RETURN & string(maxAukt)
- set W to W & RETURN & ".max towns" & RETURN & string(maxTowns)
- set W to W & RETURN & ".max solve" & RETURN & string(maxSolve)
- set W to W & RETURN & ".min days" & RETURN & string(minDays)
- set W to W & RETURN & ".max days" & RETURN & string(maxDays)
- set W to W & RETURN & ".max assign" & RETURN & string(maxAssign)
- set err to fil(mWriteString, W)
- fil(mdispose)
- end if
- if the machineType = 256 then
- closeXLib(the pathName & "FILEIO.DLL")
- end if
- PrintHighScores(maxAukt, maxTowns, maxSolve, minDays, maxDays, maxAssign)
- end
-