MODULE stupidmodule(INTEGER x)
WHILE x>1 DO
IF even(x) THEN (* x is even*)
x:= x/2
ELSE
x:= 3*x+1 (* x is odd *)
ENDIF
ENDWHILE
ENDMODULE