count = 0
for (i in 1:10000){
diceRoll = sample(1:6,2,replace = TRUE)
print(diceRoll)
if ( diceRoll[1]+diceRoll[2] < 6){
count = count + 1
}
}
print(count)
count = 0
for (i in 1:10000){
diceRoll = sample(1:6,2,replace = TRUE)
print(diceRoll)
if ( diceRoll[1]+diceRoll[2] < 6){
count = count + 1
}
}
print(count)
Prints just fine when I run your code. Maybe you can give us a little more context?
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.