This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tally(n=100) | |
snake_eyes = 0 | |
any_ones = 0 | |
for i in 1:n | |
rolls = (dice_roll(), dice_roll()) | |
if 1 in rolls # tests at least one of them is a one | |
any_ones += 1 | |
if rolls[1] == rolls[2] # tests both are one |
OlderNewer