Proposition 1: to collect what cannot be collected (by SH)

 

Z_COLLECT_ALL_NOTHING

VARIABLE
INPUTFILE=ALL.ALL
OUTPUTFILE=MINE
ALIVE TYPE=BINARY
OBJECT IN (“FOUND”, “NOT FOUND”)
TIME=T

CONSTANT
WANT

INEVITABLE
EVENT=DEATH

START:

SET ALIVE=YES

DO WHILE ALIVE=YES
PERFORM COLLECT_ALL
SET TIME=T-1
IF TIME < 1
SET EVENT=DEATH
SET ALIVE=NO
DELETE ALL MINE
ENDIF
END

COLLECT_ALL:
FOR ALL OBJECT
IF OBJECT >= 1
WRITE OBJECT INTO MINE
ELSE
PERFORM HUNT
ENDIF
END COLLECT_ALL

HUNT:
READ ALL.ALL
IF OBJECT=FOUND
WRITE OBJECT INTO MINE
ELSE
PERFORM HUNT
ENDIF
END HUNT

END.

Leave a Comment

Your email address will not be published. Required fields are marked *