Advertisement
Guest User

Untitled

a guest
Dec 4th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SetWorkingDir %A_ScriptDir%
  2. FileRead, idDataStr, % A_ScriptDir "\d4.txt"
  3.  
  4. idData := StrSplit(idDataStr, "`r`n`r`n")
  5.  
  6. count := 0
  7.  
  8. for i, j in idData {
  9.     id := {}
  10.     idA := StrSplit(j, ["`r`n", A_Space])
  11.     for k, l in idA {
  12.         a := StrSplit(l, ":")
  13.         id[a[1]] := a[2]
  14.     }
  15.  
  16.     fail := 1
  17.     colors := {amb:1, blu:1, brn:1, gry:1, grn:1, hzl:1, oth:1}
  18.  
  19.     if ((id.Count() = 8) or (id.Count() = 7 and !id.cid))
  20.     and ((id.byr >= 1920 and id.byr <= 2002) and (id.iyr >= 2010 and id.iyr <= 2020) and (id.eyr >= 2020 and id.eyr <= 2030))
  21.     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)))
  22.     and RegExMatch(id.hcl, "^#[0-9a-f]{6}$")
  23.     and colors[id.ecl]
  24.     and RegExMatch(id.pid, "^[0-9]{9}$")
  25.         fail := 0
  26.  
  27.     if !fail
  28.         count += 1
  29. }
  30.  
  31. Clipboard := count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement