--- title: "Dice Roll Program" id: 76403 type: "computer_media" slug: "dice-roll-program" url: "http://localhost/computer_media/dice-roll-program/" markdown_url: "http://localhost/computer_media/dice-roll-program.md" published_at: "2026-11-11T08:03:03+00:00" modified_at: "2026-11-11T08:03:03+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/dice-roll-program-1.png" excerpt: "Roll two dice on the ZX81, drawn large with graphic characters; the dice roll again every few seconds or when you press a key." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "David Rowland" slug: "david-rowland" taxonomy: "indiv" url: "http://localhost/indiv/david-rowland/" genre: - name: "Dice" slug: "dice" taxonomy: "genre" url: "http://localhost/type/dice/" media_type: "Program" programmers: - name: "David Rowland" slug: "david-rowland" taxonomy: "indiv" url: "http://localhost/indiv/david-rowland/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Dice%20Roll%20Program%20%281982%29%28Rowland%2C%20David%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/dice-roll-program-1.png" - url: "http://localhost/wp-content/uploads/2026/11/dice-roll-program-2.png" article_media: - id: 65567 title: "Dice Roll Program — 8K/1-2K" type: "article" url: "http://localhost/article/dice-roll-program-8k-1-2k/" media_type_tags: "Dice" license: false --- # Dice Roll Program The program draws two dice with their spots in graphic characters, waits about 16 seconds or until you press a key, and rolls again. Stop it with BREAK. Two versions are printed: the first, and a second that replaces lines 5-60 with a more compact way of drawing the spots. The article also gives a two-line change to save memory in the second version. The download has both versions. In testing, the first version ran in 1K; the second stopped with report 4 at line 55 in 1K and ran in 2K. Published in Syntax April 1982 ([Dice Roll Program — 8K/1-2K](https://timexsinclair.com/article/dice-roll-program-8k-1-2k/)). ## Source Code ``` 5 RAND 10 FOR M=31 TO 13 STEP -2.6 20 PLOT 7,M 30 PLOT 26,M 40 PLOT 33,M 50 PLOT 52,M 60 NEXT M 70 FOR B=0 TO 13 STEP 13 80 LET Y=INT (RND*6)+1 90 IF Y=1 OR Y=3 OR Y=5 THEN PRINT AT 10,8+B;CHR$ 128 100 IF Y<>1 THEN PRINT AT 7,5+B;CHR$ 128;AT 13,11+B;CHR$ 128 110 IF Y=6 THEN PRINT AT 10,5+B;CHR$ 128;AT 10,11+B;CHR$ 128 120 IF Y>=4 THEN PRINT AT 7,11+B;CHR$ 128;AT 13,5+B;CHR$ 128 130 NEXT B 140 PAUSE 1000 150 CLS 160 GOTO 10 5 RAND 10 FOR C=0 TO 1 20 FOR B=0 TO 1 30 FOR M=0 TO 19 35 LET Z=19*C 40 LET A=26*B+7 45 PLOT M+A,13+Z 50 PLOT Z+A,13+M 55 NEXT M 60 NEXT B 65 NEXT C 70 FOR B=0 TO 13 STEP 13 80 LET Y=INT (RND*6)+1 90 IF Y=1 OR Y=3 OR Y=5 THEN PRINT AT 10,8+B;CHR$ 128 100 IF Y<>1 THEN PRINT AT 7,5+B;CHR$ 128;AT 13,11+B;CHR$ 128 110 IF Y=6 THEN PRINT AT 10,5+B;CHR$ 128;AT 10,11+B;CHR$ 128 120 IF Y>=4 THEN PRINT AT 7,11+B;CHR$ 128;AT 13,5+B;CHR$ 128 130 NEXT B 140 PAUSE 1000 150 CLS 160 GOTO 10 ```