perm filename ADJBP.SAI[HAK,ROB] blob sn#506216 filedate 1980-04-26 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	BEGIN "ADJBP"
C00004 ENDMK
C⊗;
BEGIN "ADJBP"

REQUIRE "HEADER.SAI[LIB,ROB]" SOURCE!FILE;

DEFINE ADJBP = '133000000000;
STRING str;
INTEGER r2,r3,count,brk,seed,first,second;

INTEGER PROCEDURE Cycle(
  REFERENCE INTEGER r2,r3);
  Q⊂ "Cycle"
  LABEL loop;
	MOVE 2,R2		;  ! Set up the old args;
	MOVE 3,R3		;
	SETOM 1			;  ! Initialize the counter;
LOOP:	AOS 1			;  ! Bump the count;
	ADJBP 2,2		;  ! F(r2);
	ADJBP 3,3		;  ! F(F(r3));
	ADJBP 3,3		;
	CAME 2,3		;  ! Loop until they are equal;
	JRST LOOP		;
	MOVEM 2,R2		;  ! Save the args back for later;
	MOVEM 3,R3		;  ! Count is returned in 1;
  ⊃ "Cycle";

PRINT("SEED	INTIAL	LENGTH",↓);
FOR seed ← 0 THRU '777777 DO
  ⊂ "MLOOP"
  r2 ← r3 ← '441300000000 LOR seed;	! Initialize the values;
  first ← Cycle(r2,r3);
  second ← Cycle(r2,r3);
  IF (second≠30) AND (second≠137)
    THEN PRINT(seed,tab,first,tab,second,↓)
    ELSE IF (seed MOD 1000) = 0 THEN PRINT("..",seed,"..");
  ⊃ "MLOOP";

END "ADJBP";