# COLLATZ INCREASE I INCREASE I INCREASE I INCREASE I INCREASE I REPEAT I TIMES ( REPEAT I TIMES ( INCREASE I ) ) INCREASE L # L for Loop variable. Handles breaking. REPEAT I TIMES ( REPEAT L TIMES ( PRINT X REPEAT X TIMES ( INCREASE B REPEAT A TIMES ( CLEAR A INCREASE O CLEAR B ) REPEAT B TIMES ( INCREASE A CLEAR B ) ) CLEAR A CLEAR B # O = round(X/2) INCREASE D INCREASE D REPEAT X TIMES ( INCREASE Z ) REPEAT O TIMES ( REPEAT D TIMES ( REPEAT Z TIMES ( REPEAT C TIMES ( INCREASE Y CLEAR C ) INCREASE C ) CLEAR Z REPEAT Y TIMES ( INCREASE Z ) CLEAR C CLEAR Y ) ) CLEAR D # Z = X mod 2 INCREASE B REPEAT Z TIMES ( INCREASE A INCREASE A INCREASE A REPEAT A TIMES ( REPEAT X TIMES ( INCREASE T ) ) INCREASE T CLEAR A CLEAR X REPEAT T TIMES ( INCREASE X ) CLEAR B ) REPEAT B TIMES ( CLEAR X REPEAT O TIMES ( INCREASE X ) CLEAR B ) # BREAK LOGIIKKA CLEAR L REPEAT X TIMES ( INCREASE L ) REPEAT L TIMES ( REPEAT C TIMES ( INCREASE Y CLEAR C ) INCREASE C ) CLEAR C # Y = X - 1 REPEAT Y TIMES ( CLEAR Y INCREASE Y ) CLEAR L REPEAT Y TIMES ( INCREASE L ) CLEAR Y ) )