Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetWorkingDir %A_ScriptDir%
- FileRead, idDataStr, % A_ScriptDir "\d4.txt"
- idData := StrSplit(idDataStr, "`r`n`r`n")
- count := 0
- for i, j in idData {
- id := {}
- idA := StrSplit(j, ["`r`n", A_Space])
- for k, l in idA {
- a := StrSplit(l, ":")
- id[a[1]] := a[2]
- }
- fail := 1
- colors := {amb:1, blu:1, brn:1, gry:1, grn:1, hzl:1, oth:1}
- if ((id.Count() = 8) or (id.Count() = 7 and !id.cid))
- and ((id.byr >= 1920 and id.byr <= 2002) and (id.iyr >= 2010 and id.iyr <= 2020) and (id.eyr >= 2020 and id.eyr <= 2030))
- and ((SubStr(id.hgt, -1) = "cm" and (SubStr(id.hgt, 1, -2) >= 150 and SubStr(id.hgt, 1, -2) <= 193)) or (SubStr(id.hgt, -1) = "in" and (SubStr(id.hgt, 1, -2) >= 59 and SubStr(id.hgt, 1, -2) <= 76)))
- and RegExMatch(id.hcl, "^#[0-9a-f]{6}$")
- and colors[id.ecl]
- and RegExMatch(id.pid, "^[0-9]{9}$")
- fail := 0
- if !fail
- count += 1
- }
- Clipboard := count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement