parent
c5299c719f
commit
55d78ab5ce
@ -0,0 +1,15 @@
|
||||
X = 7
|
||||
|
||||
WHILE X != 1
|
||||
WHILE X % 2 == 1
|
||||
X = 3*X + 1
|
||||
PRINT X, " "
|
||||
END WHILE
|
||||
|
||||
DO
|
||||
X = X / 2
|
||||
PRINT X, " "
|
||||
LOOP WHILE X % 2 == 0
|
||||
WEND
|
||||
|
||||
PRINT_FLUSH(message1)
|
@ -0,0 +1,42 @@
|
||||
set X 7
|
||||
main__label_0_start:
|
||||
set main__tmp_1 X
|
||||
set main__tmp_2 1
|
||||
op notEqual main__tmp_0 main__tmp_1 main__tmp_2
|
||||
jump main__label_1_end equal main__tmp_0 false
|
||||
main__label_2_start:
|
||||
set main__tmp_6 X
|
||||
set main__tmp_7 2
|
||||
op mod main__tmp_4 main__tmp_6 main__tmp_7
|
||||
set main__tmp_5 1
|
||||
op equal main__tmp_3 main__tmp_4 main__tmp_5
|
||||
jump main__label_3_end equal main__tmp_3 false
|
||||
set main__tmp_10 3
|
||||
set main__tmp_11 X
|
||||
op mul main__tmp_8 main__tmp_10 main__tmp_11
|
||||
set main__tmp_9 1
|
||||
op add X main__tmp_8 main__tmp_9
|
||||
set main__tmp_12 X
|
||||
print main__tmp_12
|
||||
set main__tmp_13 " "
|
||||
print main__tmp_13
|
||||
jump main__label_2_start always 0 0
|
||||
main__label_3_end:
|
||||
main__label_4_start:
|
||||
set main__tmp_15 X
|
||||
set main__tmp_16 2
|
||||
op div X main__tmp_15 main__tmp_16
|
||||
set main__tmp_17 X
|
||||
print main__tmp_17
|
||||
set main__tmp_18 " "
|
||||
print main__tmp_18
|
||||
set main__tmp_21 X
|
||||
set main__tmp_22 2
|
||||
op mod main__tmp_19 main__tmp_21 main__tmp_22
|
||||
set main__tmp_20 0
|
||||
op equal main__tmp_14 main__tmp_19 main__tmp_20
|
||||
jump main__label_4_start equal main__tmp_14 true
|
||||
jump main__label_0_start always 0 0
|
||||
main__label_1_end:
|
||||
set main__tmp_23 message1
|
||||
printflush main__tmp_23
|
@ -0,0 +1,21 @@
|
||||
set X 7
|
||||
main__label_0_start:
|
||||
jump main__label_1_end equal X 1
|
||||
main__label_2_start:
|
||||
op mod main__tmp_4 X 2
|
||||
jump main__label_3_end notEqual main__tmp_4 1
|
||||
op mul main__tmp_8 3 X
|
||||
op add X main__tmp_8 1
|
||||
print X
|
||||
print " "
|
||||
jump main__label_2_start always 0 0
|
||||
main__label_3_end:
|
||||
main__label_4_start:
|
||||
op div X X 2
|
||||
print X
|
||||
print " "
|
||||
op mod main__tmp_19 X 2
|
||||
jump main__label_4_start equal main__tmp_19 0
|
||||
jump main__label_0_start always 0 0
|
||||
main__label_1_end:
|
||||
printflush message1
|
Loading…
Reference in new issue