
 .ABS
 .LOC 100
 .TITLE LIFE
/
DACX=701544
DACY=701524
KSF=700301
KRB=700312
TLS=700406
TSF=700401
DBA=707762
/
/ CHECKING APPROXIMITY MACRO
/
 .DEFIN CHECK,D
 AXR+D
 LAC 0,X
 SZA!SMA
 ISZ COUNT
 .ENDM
/
/ INITIALIZE BUFFER BY ZEROING AND READING INPUT
/
 LAC (10000-1
 DAC 10
 LAC (-7777
 DAC TST
CLOOP DZM* 10 /CLEAR THE BUFFER
 ISZ TST
 JMP CLOOP
/
 JMS READI
 TCA
 DAC TST
 JMS CRLF
INLOOP JMS READI  /READ X
 DAC BFPT
 LAC (240
 JMS PRNT
 JMS READI
 SWHA
 RTR
 RAR
 XOR (10000
 XOR BFPT
 DAC BFPT
 CLA!IAC
 DAC* BFPT
 JMS CRLF
 ISZ TST
 JMP INLOOP
 JMS DISP
/
 /
/ START GENERATING
/
GEN LAC (10000
 DAC 10
 LAC (-7777
 DAC TST
 DBA
LOOP DZM COUNT   /ZERO NEAREST NEIGHBOURS
 LAC* 10
 SZA
 CLA!CMA
 DAC MT
 LAC 10
 PAX
 CLA
 CHECK 100
 CHECK 1
 CHECK -2
 CHECK -100
 CHECK 2
 CHECK -100
 CHECK -1
 CHECK -1
/
 AXR 101  /BACK TO CENTRE
 ISZ MT
 JMP C3
 LAC COUNT
 CLL!RAR
 SZA
 JMP DED
 CLL!RAR
 SZA
 JMP OUT
DED LAC (2
 DAC 10000
 JMP OUT
/
C3 LAC (3
 SAD COUNT
 SKP
 JMP OUT
 CLA!CMA
 DAC 10000
/
OUT  ISZ TST
 JMP LOOP
/
 LAC (10000-1
 DAC 10
 LAC (-7777
 DAC TST
ZLOOP LAC 20
 SNA
 JMP OK
 SPA
 JMP PUT
 SAD (2
 DZM 20
INC ISZ 20
 ISZ TST
 JMP ZLOOP
 JMS DISP
 JMP GEN
PUT CLA!IAC
 DAC 20
 JMP INC
READI 0
 JMS READ
 AND (17
 RTL
 RAL
 DAC TEMP
 JMS READ
 AND (17
 XOR TEMP
 JMP* READI
TEMP 0
/
READ 0
 KSF
 JMP .-1
 KRB
 JMP* READ
/
CRLF 0
 LAC (15
 JMS PRNT
 LAC (12
 JMS PRNT
 JMP* CRLF
/
PRNT 0
 TLS
 TSF
 JMP .-1
 JMP* PRNT
/
/  DISPLAY BUFFER ROUTINE
/
DISP 0
 701561
 LAS
 AND (777
 CMA
 DAC LCOUNT
 LAS
 SWHA
 AND (777
 CMA
 DAC TIME
 LAC (10000-1
 DAC 10
 LAC (-7777
 DAC TST
DLOOP LAC* 10
 SNA
 JMP TEST
 LAC 10
 AND (77
 SWHA
 RTL
 RAL
 DACX
 LAC 10
 AND (7700
 RTL
 RTL
 RTL
 DACY
 JMS PAUSE
TEST ISZ TST
 JMP DLOOP
 ISZ LCOUNT
 JMP DLOOP-4
 JMP* DISP
/
PAUSE 0
 LAC TIME
 DAC TCOUNT
 ISZ TCOUNT
 JMP .-1
 JMP* PAUSE
TIME -1
TCOUNT 0
/
TST 0
LCOUNT 0
BFPT 0
 .END
