Advertisement
Guest User

Nunki3’s AHK day 10

a guest
Dec 10th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FileRead, Input, 10.txt
  2.  
  3. x := 1, cycle := 1, total := 0, str := ""
  4. for i, line in StrSplit(Input, ["`r`n", A_Space]) {
  5.     addx := 0
  6.     if line is number
  7.         addx := line
  8.    
  9.     ;2
  10.     if (Mod(cycle-1, 40) = 0)
  11.         str .= "`r`n"
  12.     if (Mod(cycle-1, 40) >= x-1) and (Mod(cycle-1, 40) <= x+1)
  13.         str .= "█"
  14.     else
  15.         str .= " "
  16.  
  17.     cycle += 1
  18.     x += addx
  19.  
  20.     ;1
  21.     if (Mod(cycle+20, 40) = 0)
  22.         total += cycle * x
  23. }
  24. ;1
  25. MsgBox, % total
  26. ;2
  27. Clipboard := str
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement