About 284,000 results
Open links in new tab
  1. simulating rolling 2 dice in Python - Stack Overflow

    This basically does the same thing as the for loop in the first example; loop n times, summing up that many random numbers between 1 and 6 inclusive. If instead of rolling n times, you need to produce …

  2. Roll two dice java program - Stack Overflow

    I need to write a simple java program "Roll the Dice" with special variables: When the user rolls the dice, the application rolls two dice, displays the results of each, and asks if the user wants to

  3. Rolling 2 dice in Python and if they are the same number, roll again ...

    Feb 17, 2019 · Rolling 2 dice in Python and if they are the same number, roll again, and continuing Asked 7 years, 2 months ago Modified 7 months ago Viewed 6k times

  4. loops - Simulating Dice Rolls in R - Stack Overflow

    Sep 7, 2021 · I am trying to code the following game in R: Roll a dice until you observe a 4 followed by a 6 Count how many times it took you to observe a 4 followed by a 6 Repeat these first two steps 100 …

  5. r - simulating rolling two dice - Stack Overflow

    Feb 12, 2013 · How does the first solution seem brute force or inelegant? It's a 1 line solution. Is your issue that you can't roll an arbitrary # of dice?

  6. A Program for Simulating the Rolling of 2 Dice - Stack Overflow

    Nov 13, 2014 · The following is the whole question. Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and should use rand again to roll the second die...

  7. Python - creating 2 dice to roll fairly and add them together?

    Jun 19, 2015 · "Then write another function that simulates rolling two fair dice. The easy way is to call the function you just wrote, twice, and add the numbers you get. This should return a number …

  8. c# - Basic Roll the Dice number generator - Stack Overflow

    Hello im very new to C# and coding, so need some basic help. If the user chooses to roll multiple dices, (2,3,4,5,6,7,8 etc), what do you do to make it roll randomly on all the dices? For example: ...

  9. Rolling two dice and tabulating outcomes - Stack Overflow

    May 12, 2014 · Use the random library and the randint function therein (random.randint (1,6)) for each dice. Add the numbers from each dice, and keep a count of each possible roll (2-12), and how many …

  10. montecarlo - Python, roll 2 dice and sum up the outcomes 10000 times ...

    Apr 13, 2023 · Question is to use Monte carlo sample for throw of 10000 dice pairs of 10-faced dice, sum each pair, count the occurrence of each outcome and plot in histogram. This is my code: import …