C
C		GENERALIZED FORTRAN SUBROUTINE TO PRINT THE RULES FOR
C		FORTRAN GAMES PROGRAMS
C
C		PARAMETERS:  CALL WITH THE 4-WORD RADIX-50 DESCRIPTOR
C		OF A FILE CONTAINING THE RULES
C
C		EXAMPLE: CALL RULES(12RDK0WUMPUSDOC)
C
C		RULES WILL ASK THE USER IF THEY NEED INSTRUCTIONS.
C		IF THE STRING TYPED STARTS WITH A 'Y', THE FILE IS
C		OPENED AND COPIED TO THE TERMINAL.
C		LINES IN THE RULES FILE THAT START WITH A ';' ARE NOT
C		PRINTED.
C
C		LINES THAT START WITH A CIRCUMFLEX (^) ARE ALSO NOT
C		PRINTED, BUT THE PROGRAM PAUSES TO ALLOW READERS TO CATCH UP
C		AND PROMPTS FOR A RETURN
C
	SUBROUTINE RULES(NAME)
	IMPLICIT INTEGER(A-Z)
	BYTE CIRCUM,Y,SEMI,BUF(80)
	INTEGER*2 NAME(4)
	DATA Y,SEMI/'y',';'/
	DATA CIRCUM/'^'/
	DATA LINES/0/
	WRITE(7,100)
100	FORMAT('$DO YOU NEED INSTRUCTIONS? ')
	READ(5,400)BUF
400	FORMAT(80A1)
	BUF(1)=BUF(1) .OR. "40   !TURN UPPER TO LOWER CASE
	IF (BUF(1) .NE. Y) RETURN
	IF(IASIGN(2,NAME(1),NAME(2)) .NE. 0) RETURN
10	READ(2,200,END=99,ERR=99)LN,BUF
	IF (BUF(1) .EQ. SEMI) GOTO 10
	IF (BUF(1) .EQ. CIRCUM) GOTO 15
200	FORMAT(Q,80A1)
	IF (LINES .LT. 23) GOTO 20
15	WRITE(7,500)
500	FORMAT('$			Hit return for more rules:')
	READ(5,200,END=99,ERR=99)I,LINES
	IF(I.GT.0) GO TO 99
	LINES=0
	IF (BUF(1) .EQ. CIRCUM) GOTO 10
20	WRITE(7,300)(BUF(I),I=1,LN)
300	FORMAT(1X,80A1)
	LINES=LINES+1
	GOTO 10
99	CALL CLOSE(2)
	RETURN
	END
