A quiet, fair pair of dice for a 1K ZX80. Each press of NEWLINE rolls two dice and draws them one above the other as graphic die faces with the right pattern of pips. Enter any character to stop.
Subroutine 700 arranges the pips for each face and subroutine 800 draws the die. SYNTAX printed the graphics as key descriptions (7space shiftQ and so on); the file has the characters themselves.
Published in Syntax August 1982 (Dice Roll).
Source Code
5 LET A$=" ▌ "
10 LET B$=CHR$(130)
15 LET X$=" ▌"
30 RANDOMISE
40 LET X=RND(6)
50 LET Y=RND(6)
60 LET Z=X
70 GO SUB 700
80 GO SUB 800
90 PRINT
100 LET Z=Y
110 GO SUB 700
120 GO SUB 800
130 INPUT Q$
135 CLS
140 IF Q$="" THEN GO TO 40
150 STOP
700 LET C$="▒ ▒"
701 LET D$=C$
702 LET E$=C$
705 IF Z=1 THEN LET C$=" "
706 IF Z=1 THEN LET E$=C$
710 IF Z=1 OR Z=3 OR Z=5 THEN LET D$=" ▒ "
720 IF Z=2 OR Z=3 THEN GO SUB 750
730 IF Z=2 OR Z=4 THEN LET D$=" "
740 RETURN
750 LET C$="▒ "
760 LET E$=" ▒"
770 RETURN
800 LET Z$="▄"
805 GO SUB 900
810 PRINT A$;B$
820 PRINT X$;C$;" ";B$
830 PRINT A$;B$
840 PRINT X$;D$;" ";B$
850 PRINT A$;B$
860 PRINT X$;E$;" ";B$
870 PRINT A$;B$
875 LET Z$=CHR$(131)
880 GO SUB 900
890 RETURN
900 PRINT " ";
910 FOR I=1 TO 10
920 PRINT Z$;
930 NEXT I
940 PRINT
950 RETURNNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

