musifter

AoC 2025, day 1, part 1 (dc)

Dec 1st, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. # Command: tr 'LR' '_ ' <input | dc -fdc-p1.dc
  2.  
  3. 0                   # count
  4. [r1+r] sP           # inc count macro
  5.  
  6. 50
  7. ?                   # move pos count
  8. [
  9.     +A0% d0=P       # move = (move + pos) % 100; count++ if 0
  10.     ? z2<M
  11. ] dsMx
  12.  
  13. [Part 1: ]nrp
Advertisement
Add Comment
Please, Sign In to add comment