Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List := StrSplit(FileOpen("day3_input.txt","R").Read(),"`r`n")
- result := 1
- for _, v in [[1,1],[3,1],[5,1],[7,1],[1,2]]
- result *= GetNumberOfHitTrees(v[1],v[2],List)
- MsgBox % result
- GetNumberOfHitTrees(right,down,list) {
- index := count := 0
- for k, v in list {
- if !Mod(k-1,down) {
- index++
- count += (SubStr(v,Mod(1+(index-1)*right,StrLen(v)),1)="#")
- }
- }
- return % count
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement