Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Ranking-methods/AutoHotkey/ranking-methods-1.ahk
Normal file
22
Task/Ranking-methods/AutoHotkey/ranking-methods-1.ahk
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Rank(data, opt:=1){ ; opt = 1 Standard (default), 2 Modified, 3 Dense, 4 Ordinal, 5 Fractional
|
||||
for index, val in StrSplit(data, "`n", "`r") {
|
||||
RegExMatch(val, "^(\d+)\s+(.*)", Match)
|
||||
if !(Match1=prev)
|
||||
n := index
|
||||
prev := Match1
|
||||
Res1 .= n "`t" Match "`n"
|
||||
Res4 .= index "`t" Match "`n"
|
||||
Temp .= n ":" index " " Match "`n"
|
||||
}
|
||||
n:=0
|
||||
while pos := RegExMatch(Temp, "`asm)^(\d+).*?\R(?!\1)|.+", Match, pos?pos+StrLen(Match):1) {
|
||||
n += StrSplit(Trim(Match, "`r`n"), "`n", "`r").MaxIndex()
|
||||
Res2 .= RegExReplace(Match, "`am)^\d+:\d+", n "`t")
|
||||
Res3 .= RegExReplace(Match, "`am)^\d+:\d+", A_Index "`t")
|
||||
R := 0
|
||||
for index, val in StrSplit(Match, "`n", "`r")
|
||||
R += StrSplit(val, ":").2
|
||||
Res5 .= RegExReplace(Match, "`am)^\d+:\d+", RegExReplace(R / StrSplit(Trim(Match, "`r`n"), "`n", "`r").MaxIndex(), "\.?0+$") "`t")
|
||||
}
|
||||
return Res%opt%
|
||||
}
|
||||
18
Task/Ranking-methods/AutoHotkey/ranking-methods-2.ahk
Normal file
18
Task/Ranking-methods/AutoHotkey/ranking-methods-2.ahk
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
data =
|
||||
(
|
||||
44 Solomon
|
||||
42 Jason
|
||||
42 Errol
|
||||
41 Garry
|
||||
41 Bernard
|
||||
41 Barry
|
||||
39 Stephen
|
||||
)
|
||||
|
||||
MsgBox, 262144, ,% ""
|
||||
. "Standard Ranking:`n" Rank(data)
|
||||
. "`nModified Ranking:`n" Rank(data, 2)
|
||||
. "`nDense Ranking:`n" Rank(data, 3)
|
||||
. "`nOrdinal Ranking:`n" Rank(data, 4)
|
||||
. "`nFractional Ranking:`n" Rank(data, 5)
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue