Advertisement
Guest User

Nunki3’s AHK day 2

a guest
Dec 4th, 2022
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FileRead, Input, 2.txt
  2.  
  3. ;1
  4. score := 0
  5. for i, round in StrSplit(Input, "`r`n`") {
  6.     opp := asc(StrSplit(round, A_Space)[1]) - 96 + 32
  7.     me := asc(StrSplit(round, A_Space)[2]) - 96 - 23 + 32
  8.     s := (Mod(opp+3 - me+3, 3))
  9.     if (s = 0)
  10.         score += 3
  11.     else if (s = 2)
  12.         score += 6
  13.     score += me
  14. }
  15. MsgBox, % score
  16.  
  17. ;2
  18. score := 0
  19. for i, round in StrSplit(Input, "`r`n`") {
  20.     opp := asc(StrSplit(round, A_Space)[1]) - 96 + 32 - 1
  21.     res := asc(StrSplit(round, A_Space)[2]) - 96 - 23 + 32 - 2
  22.     score += ((res+1) * 3) + (Mod(opp + res + 6, 3) + 1)
  23. }
  24. MsgBox, % score
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement