86 lines
1.3 KiB
AutoHotkey
86 lines
1.3 KiB
AutoHotkey
|
#SingleInstance, Force
|
||
|
loc := A_ScriptDir "\data3.txt"
|
||
|
file := FileOpen(loc, "r")
|
||
|
down := 1
|
||
|
right := 1
|
||
|
while !(file.AtEOF) {
|
||
|
data := StrSplit(file.ReadLine())
|
||
|
If (right > 31)
|
||
|
right -= 31
|
||
|
If (data[right] ~= "#")
|
||
|
p1++
|
||
|
down++
|
||
|
right += 3
|
||
|
}
|
||
|
file.Pos := 0
|
||
|
down := 1
|
||
|
right := 1
|
||
|
|
||
|
while !(file.AtEOF) {
|
||
|
data := StrSplit(file.ReadLine())
|
||
|
If (right > 31)
|
||
|
right -= 31
|
||
|
If (data[right] ~= "#")
|
||
|
p2a++
|
||
|
down++
|
||
|
right += 1
|
||
|
}
|
||
|
file.Pos := 0
|
||
|
down := 1
|
||
|
right := 1
|
||
|
|
||
|
while !(file.AtEOF) {
|
||
|
data := StrSplit(file.ReadLine())
|
||
|
If (right > 31)
|
||
|
right -= 31
|
||
|
If (data[right] ~= "#")
|
||
|
p2b++
|
||
|
down++
|
||
|
right += 3
|
||
|
}
|
||
|
file.Pos := 0
|
||
|
down := 1
|
||
|
right := 1
|
||
|
|
||
|
while !(file.AtEOF) {
|
||
|
data := StrSplit(file.ReadLine())
|
||
|
If (right > 31)
|
||
|
right -= 31
|
||
|
If (data[right] ~= "#")
|
||
|
p2c++
|
||
|
down++
|
||
|
right += 5
|
||
|
}
|
||
|
file.Pos := 0
|
||
|
down := 1
|
||
|
right := 1
|
||
|
|
||
|
while !(file.AtEOF) {
|
||
|
data := StrSplit(file.ReadLine())
|
||
|
If (right > 31)
|
||
|
right -= 31
|
||
|
If (data[right] ~= "#")
|
||
|
p2d++
|
||
|
down++
|
||
|
right += 7
|
||
|
}
|
||
|
file.Pos := 0
|
||
|
down := 1
|
||
|
right := 1
|
||
|
|
||
|
while !(file.AtEOF) {
|
||
|
skip := (down-1)*32
|
||
|
If !(file.Pos = skip){
|
||
|
file.ReadLine()
|
||
|
Continue
|
||
|
} Else
|
||
|
data := StrSplit(file.ReadLine())
|
||
|
If (right > 31)
|
||
|
right -= 31
|
||
|
If (data[right] ~= "#")
|
||
|
p2e++
|
||
|
down += 2
|
||
|
right++
|
||
|
}
|
||
|
file.Close()
|
||
|
MsgBox % "Part 1: " p1 "`nPart 2: " p2a "*" p2b "*" p2c "*" p2d "*" p2e " = " p2a*p2b*p2c*p2d*p2e
|