Submission details
Task:Lukujono
Sender:Tmotomaster
Submission time:2025-11-16 17:58:04 +0200
Language:text
Status:READY
Result:23
Feedback
groupverdictscore
#1ACCEPTED23
Test results
testverdicttimescore
#1ACCEPTED0.00 s23details

Code

# DAD TEST

INCREASE F # F = 1 to print 1 once at the end

INCREASE I # Number of iterations to fake recursion
INCREASE I
INCREASE I
INCREASE J
INCREASE J

REPEAT I TIMES (
  REPEAT J TIMES (
    REPEAT I TIMES (
      INCREASE I
    )
  )
)
# I = 192 (~>180 max length)

REPEAT I TIMES (
  # Repeat enough times for X to reach 1, but not too many

  CLEAR A # Pre-clear A - new X

  # Goal: Do if X does not equal 1
  # via E = 1
  CLEAR B
  CLEAR C
  CLEAR D
# CLEAR E
  INCREASE D
  INCREASE B

  REPEAT X TIMES (
    REPEAT C TIMES (
      CLEAR C # Skip this block next turn
      CLEAR D # X != 1 and we set D = 0
      CLEAR E # E max at 1
      INCREASE E
      INCREASE T # Increasing T instead of B to skip next block
      INCREASE A # Pre-calculate X / 2
    )
    REPEAT B TIMES (
      INCREASE C
      CLEAR B # Skip this block next turn
    )
    REPEAT T TIMES (
      INCREASE B # Now we increase B we postponed earlier
      CLEAR T
    )
  )
  # Now: E = 1 if X > 1
  #      D = 1 if X = 1
  # B = 1 if X is even, else B = 0
  # C = 1 if X is odd, else C = 0

  # Goal: current X until we're done
  REPEAT F TIMES (
    PRINT X # Print current X
    REPEAT D TIMES (
      CLEAR F # Clear F to avoid printing 1 again
    )
  )

  # Goal: Execute the following part only when X > 1
  REPEAT E TIMES (

    CLEAR X

    # goal: A = X / 2
    REPEAT B TIMES (
      REPEAT A TIMES (
        INCREASE X
      )
    )

    # goal: X = A * 6 + 4
    REPEAT C TIMES (
      # knowledge: X = 0, J = 2, A = X / 2
      INCREASE X
      INCREASE X
      INCREASE X
      REPEAT X TIMES (
        REPEAT J TIMES (
          REPEAT A TIMES (
            INCREASE X
          )
        )
      )
      INCREASE X
    )
  )
)

Test details

Test 1 (public)

Verdict: ACCEPTED

input
(empty)

correct output
(empty)

user output
# DAD TEST

INCREASE F # F = 1 to print 1 ...

Feedback: 230 tests processed (command limit exceeded)