Skip to content

Instantly share code, notes, and snippets.

@0racle
Created December 29, 2022 23:21
Show Gist options
  • Save 0racle/e89b61ebb652860923f4ce6ce1285fa3 to your computer and use it in GitHub Desktop.
Save 0racle/e89b61ebb652860923f4ce6ce1285fa3 to your computer and use it in GitHub Desktop.
AoC 2022 Day 10 in J
NB. === Advent of Code [2022] ===
NB. --- Day 10: Cathode-Ray Tube ---

addx =. noop =. 0
s =. +/\ 1, ".@> (LF,' ') cutopen fread 'input'
echo (20 + 40 * i. 6) +/@([ * ] {~ <:@[) s
echo _40 ({&' #')\ 1 >: | (] -~ 40 | i.@#) s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment