# Questions tagged [dice]

Simulations of fair N-sided die tosses and other games of chance involving random number generation.

24 questions
Filter by
Sorted by
Tagged with
2k views

### Random number generation in Dice class

I don't intend on implementing this into an application yet as I'm going to test it first. As such, it doesn't do much beyond rolling. It also overloads some "typical" operators such as ...
2k 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 ...
5k views

### WinForms dice roller

I am writing a dice roller winforms application using C# 2012 VS. Dice roller is set up for playing Shadowrun tabletop. I feel that there might be too much code going into the GUI, but I am unsure ...
2k views

### 2 player dice game, where even total gains points and odd total loses points NEA task computer science

This is a game for two users who roll 2 dice 5 times. If the total of dice is even the player gains 10 points if it is odd, they lose 5. If there it is a draw after five rounds then the both users ...
27k views

### Simple text RPG in Python

I am trying to teach myself to code using Python. The following is the first real program I have written from scratch. I feel that it is messy and in need of improvement, but I am either unsure of ...
1k 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 ...
13k views

### Two-player dice game for NEA task computer science (Updated)

This is a game for two users who roll 2 dice 5 times. If the total of dice is even the player gains 10 points; if it is odd, they lose 5. If there is a draw after five rounds then both users will ...
1k views

### Spin-the-bottle-like game

I've started coding about 3 weeks ago, just for fun and maybe practical uses later. My GF dared me to make a PGM that would replace this dice game where you roll two dice, one with body parts and one ...
2k views

### Random D20 number generator

I'm teaching myself code using Zed Shaw's Learn Python The Hard Way, and I got bored during one of the memorization lessons so I thought I would make a random D20 number generator for when I play RPGS....
6k views

### Craps game rules and code

I'm developing a small craps game in C++, and my C++ skills are a bit rusty. I really need someone to review my code to ensure that I have correctly implemented the game according to the rules. ...
2k views

### Petals Around the Rose

I have been working on a program that walks you through "Petals Around the Rose". I would like anyone to review it and point out any bad coding practices, as well as efficiency problems. ...
1k views

### Ten Thousand: a dice game for multiple players

A fun little game for as many players as you have friends. This is my first Python project so any advice on how to improve is welcome and appreciated. I'm not concerned with the clunky interface as I'...
2k views

### Playing “craps” for the win

No specific question here. I am beginning with Java and here is an exercise. The rules of game: You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots, ...
262 views

### Ten Thousand: a dice game for multiple players - follow-up

I've implemented the advice given here and elsewhere as best as I understand: Ten Thousand: a dice game for multiple players I've added a computer player as well. Help me make it even better. What is ...
75 views

### Frequency analysis for simultaneous dice rolls

My professor told me to optimize my perl code, but he wouldn't tell me what exactly - just make it simpler. I changed some little things but nothing major. Am I missing something? The task was: ...
25k views

### simple two players dice throwing game

I'm a first year uni student. We were asked to come up with code that can represent a simple two players dice throwing game (specifications are given below). I know as a matter of fact that there are ...
3k views

### Python dice class

I've built a simple dice class utility for rolling dice. It supports weighted rolling, and usage is fairly simple. Here's the code. ...
204 views

### Spin-the-bottle-like game, follow-up

I've posted this some time ago. Here is the new version that I made based on all the comments that were made. Another look would be much appreciated, especially on: Getting rid of the ...
16k views

### Java Dice Roller

I've written a basic dice program in Java which takes a number of faces then randomly selects a number within that boundary. Here is the code: ...
289 views

### Exurbb (automated turn based) Battle Simulator

I have created a semi-medium program (in size) to simulate any battle for all of your battling needs! I would like some feedback on how it is (not to great at programming in c++) or you can just put ...
347 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 ...
1k views

### Dice-rolling Python script

I completed writing a dice roll script in Python but I thought it looked too messy. Is there anything I should change here? ...