Compucolor.org – Virtual Media

Listing of file='DICE.FOR;0A' on disk='vmedia/backgammon-sideB-sector.ccvf'

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C	DICE SUBROUTINES
C
	SUBROUTINE ROLL(F,D)
	INTEGER D(4)
	BYTE F,NEXT
	BYTE I,K,K1
	COMMON /TEMP/T1,T2,T3,T4

	CALL CLEAR
	DO 4120 K=1,2
	D(K)= INT(RND(1.0)*5.999999+1.0)
	K1  = INT(RND(1.0)*10.0+1.0)
	DO 4120 I=1,K1
	T1 = I
	T2 = RND(1.0)
4120	CONTINUE

	DO 4140 I=1,11
	NEXT = INT(6.0*RND(1.0)+1.0)
	CALL DICE(5,7,NEXT)
	NEXT = INT(6.0*RND(1.0)+1.0)
	CALL DICE(13,7,NEXT)
4140	CONTINUE

	CALL DICE(5,7,D(1))
	CALL DICE(13,7,D(2))
	F= 2
	D(3)= 0
	D(4)= 0
	IF(D(1).NE.D(2))RETURN
	D(3)= D(1)
	D(4)= D(1)
	F= 4
	RETURN
	END

	SUBROUTINE CLEAR
	BYTE Y
	DO 100 Y=0,3
	CALL CURSOR(0,Y)
  100	CALL CO(11)
	CALL CURSOR(0,0)
	RETURN
	END

	SUBROUTINE WAIT
	INTEGER I
	DO 100 I=1,20000
  100	CONTINUE
	DO 200 I=1,20000
  200	CONTINUE
	RETURN
	END

	SUBROUTINE DICE(X,Y,N)
	BYTE X,Y,N
	BYTE PICTUR(31,6)
	DATA PICTUR/3,127,0,0,56,' ',' ',' ',' ',' ',
     *		    3,127,0,1,56,' ',' ','d',' ',' ',
     *		    3,127,0,2,56,' ',' ',' ',' ',' ',X'EF',

     *		    3,127,0,0,56,'d',' ',' ',' ',' ',
     *		    3,127,0,1,56,' ',' ',' ',' ',' ',
     *		    3,127,0,2,56,' ',' ',' ',' ','d',X'EF',

     *		    3,127,0,0,56,'d',' ',' ',' ',' ',
     *		    3,127,0,1,56,' ',' ','d',' ',' ',
     *		    3,127,0,2,56,' ',' ',' ',' ','d',X'EF',

     *		    3,127,0,0,56,'d',' ',' ',' ','d',
     *		    3,127,0,1,56,' ',' ',' ',' ',' ',
     *		    3,127,0,2,56,'d',' ',' ',' ','d',X'EF',

     *		    3,127,0,0,56,'d',' ',' ',' ','d',
     *		    3,127,0,1,56,' ',' ','d',' ',' ',
     *		    3,127,0,2,56,'d',' ',' ',' ','d',X'EF',

     *		    3,127,0,0,56,'d',' ',' ',' ','d',
     *		    3,127,0,1,56,'d',' ',' ',' ','d',
     *		    3,127,0,2,56,'d',' ',' ',' ','d',X'EF'/

	PICTUR(3,N)  = X
	PICTUR(4,N)  = Y
	PICTUR(13,N) = X
	PICTUR(14,N) = Y+1
	PICTUR(23,N) = X
	PICTUR(24,N) = Y+2
	CALL OSTR(PICTUR(1,N))
	RETURN
	END