Sorceress

2018-05a

Dec 5th, 2018
745
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DEFLNG A-Z
  2. DIM b(50000) AS _BYTE, s(50000) AS _BYTE
  3.  
  4. OPEN "input05.txt" FOR BINARY AS #1
  5. GET #1, , b()
  6. CLOSE #1
  7.  
  8. FOR i = 0 TO 49999
  9.   IF ABS(s(p) - b(i)) <> 32 THEN p = p + 1: s(p) = b(i) ELSE p = p - 1
  10. NEXT
  11. PRINT "Part 1:"; p
  12.  
  13. b() = s()
  14. FOR c = 1 TO 26: p = 0
  15.   FOR i = 0 TO 49999
  16.     IF b(i) <> c + 64 AND b(i) <> c + 96 THEN
  17.       IF ABS(s(p) - b(i)) <> 32 THEN p = p + 1: s(p) = b(i) ELSE p = p - 1
  18.     END IF
  19.   NEXT
  20.   PRINT CHR$(c + 64); p; " | ";
  21. NEXT
RAW Paste Data