All Questions
Tagged with python-2.x dice
14 questions
5
votes
3
answers
882
views
Basic python dice simulator with log function
I had created a dice simulator using nothing but functions, but I wanted to attempt one using a class for the dice just to help get a better understanding of classes. I'm still a little in the dark ...
7
votes
3
answers
2k
views
Find the total number of ways W, in which a sum S can be reached in N throws of a dice
I was solving this question:
Given there is a 6 sided dice. Find the total number of ways W, in which a sum S can be reached in N throws.
Example:
S = 1, N = 6 => W = 0
S = 6, N = 6 => W ...
3
votes
2
answers
940
views
Real time graph simulation of dice tossing
When tossing a dice many many time all numbers tend to appear the same number of times, but if the number of throws is small then some numbers may appear more or less often than others, even ...
2
votes
1
answer
1k
views
Compute the probabilities of getting each of the possible sums when throwing 2 dice, n times
I'm struggling with some coding-inexperience. The code I've written below, is extremely inconvenient and ugly to look at.
My question to you is:
How can this be done more efficiently? The way I've ...
8
votes
2
answers
2k
views
Dice roller in Python
I'm trying to get better in Python and decided to rewrite my dice roller in Perl into Python.
...
74
votes
3
answers
20k
views
Monopoly simulator
I was advised by a Reddit user to get my code reviewed on this site.
The complete code is on GitHub.
...
11
votes
4
answers
4k
views
Generate set of random numbers and remove lowest
I'm learning some Python with my kids, and we're making a program to generate D & D characters from user input.
One portion of the code is to generate stats, which are a set of six numbers where ...
5
votes
1
answer
3k
views
Pretty print dice faces from multiple rolls of multi-sided dices
In this question related to rolling multiple dices, the OP pretty prints for a single case where number of dices is less than or equal to 6. This led to me finding this code golf on "Draw dice result ...
4
votes
2
answers
380
views
Script to determine the outcome(s) of any number of dice rolls
I think this code has far to many if else clauses and not enough abstraction via functions. I would like to break the code down into a series of small functions, or methods if i decide to go OOP, but ...
3
votes
3
answers
676
views
Diceware Passphrase Generator
I've written a simple Diceware passphrase generator based on this Stack Overflow question and the top answer.
Briefly, in the Diceware method, a die is rolled 5 times for each word in the passphrase ...
7
votes
5
answers
2k
views
Interactive dice simulator
After finishing my course on CodeAcademy, I wanted to write a program. Please provide opinions.
...
2
votes
1
answer
404
views
Python Koans multiplayer Greed Game
I finished the Python Koans because I wanted to practise Python and I completed the extra assignment which is the Greed Game (see the rules here).
I think there are no flaws but you never know.
<...
3
votes
3
answers
407
views
Python greed roll
I am doing the Python Koans to practise Python a bit more and I got to the greed dice project. It is a very simple dice game that scores a set of up to five rolls.
These are the rules:
...
11
votes
2
answers
22k
views
Dice-rolling simulator
I know there is a better way to store data. What is the most concise way to simplify this script?
...