--- title: "Dice Percentages" type: "article" slug: "dice-percentages" url: "http://localhost/article/dice-percentages/" markdown_url: "http://localhost/article/dice-percentages.md" published_at: "2025-11-30T08:36:03+00:00" modified_at: "2026-06-21T23:26:54+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "I'm still distracted by my other hobby, wargaming. In tying the two together, I thought about dice, percentages, and To-Hit rolls. In gaming a To-Hit roll is a die roll, where your try to roll a certain value or less. For example, for a To-Hit roll of 10 with 2 six-sided die (2d6), you would…" category: - name: "QL Hacker's Journal" slug: "ql-hackers-journal" taxonomy: "category" url: "http://localhost/category/periodicals/ql-hackers-journal/" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Superbasic (programming language)" slug: "superbasic-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/superbasic-programming-language/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" publication_r: id: 33686 title: "QL Hacker’s Journal" type: "periodical" url: "http://localhost/periodical/ql-hackers-journal/" authors_r: - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" issue: "16" issues_articles: - id: 61552 title: "QL Hacker’s Journal 16" type: "issue" url: "http://localhost/issue/ql-hackers-journal-16/" pubdate: "January 1994" archive_link: true --- # Dice Percentages I’m still distracted by my other hobby, wargaming. In tying the two together, I thought about dice, percentages, and To-Hit rolls. In gaming a To-Hit roll is a die roll, where your try to roll a certain value or less. For example, for a To-Hit roll of 10 with 2 six-sided die (2d6), you would have to roll a die total of 10 or less. In designing a game or gaming system, it’s easy to determine the chances that something will happen by purely guessing the general percent chance that you feel that it will happen. The difficult part is translating that into terms of die. Some designers use a 10- or 20-sided die to work out the nice percentages, but others prefer to stick to 6-sided dice because of how common they are. I wrote a short program that will take a given number of 6-sided dice and print out the possible die rolls with the percent change that that number will come up, and the percent change that that number or less will come up (the To-Hit roll). ``` ** dice_ssb ** This program will simulate a number of 6 ** sided dice. It will determine what ** percentage chance a certain number ** has of rolling, and what percentage ** a number or lower has of rolling. dice = 2 DIM array(dice+1) DIM total_array(6^dice) ** Calculation Section ** Set all dice to 1 FOR x = 1 to dice array(x) = 1 NEXT x ** Set first dice to 0 so that it will ** INC to 1 in first run through the ** program. array(1) = 0 FOR y = 1 TO 6^dice array(1) = array(1)+1 total = 0 FOR x = 1 TO dice IF array(x) = 7 THEN array(x) = 1 array(x+1) = array(x+1)+1 END IF total = total+array(x) NEXT x total_array(total) = total_array(total)+1 NEXT y ** Report Section total = 0 FOR x = dice TO 6*dice temp1 = INT((total_array(x)/6^dice)*100) total = total + total_array(x) temp2 = int(((total)/6^dice)*100) print "Die roll of ";x;" ";total_array(x);" "; temp1;" ";temp2 NEXT x ```