advent2022

Advent of Code 2022 Solutions
git clone https://todayiwilllaunchmyinfantsonintoorbit.com/advent2022.git
Log | Files | Refs

4a.sno (722B)


      1         &TRIM = 1
      2         COUNT = 0
      3         DIGITS = '0123456789'
      4         INPUT('IN', 1, , 'input')               :S(START)
      5         OUTPUT = "Couldn't open input"          :(FINISH)
      6 START   LINE = IN                               :F(FINISH)
      7         LINE SPAN(DIGITS) . S1START '-' SPAN(DIGITS) . S1END ',' SPAN(DIGITS) . S2START '-' SPAN(DIGITS) . S2END                                  :F(START)
      8         EQ(S1START, S2START)                    :S(COUNT)
      9         LT(S1START, S2START)                    :S(S2INS1)
     10         GE(S2END, S1END)                        :S(COUNT) F(START)
     11 S2INS1  GE(S1END, S2END)                        :F(START)
     12 COUNT   COUNT = COUNT + 1                       :(START)
     13 FINISH  OUTPUT = COUNT
     14 END