Questions tagged [dice]

Dice are small objects thrown by hand that land in different positions, used to generate random value for games, particularly gambling.

A die (plural dice) is a small object (most commonly a cube) designed to be thrown onto a surface. Markings on the face of the die chosen by how it lands indicate a value that is thereby chosen randomly. Dice have been used for centuries--even longer than playing cards--for gambling and other games.

882 questions
5
votes
5 answers

C# code only gives expected results on step through?

Ok so I have a dice throw app... When I step through the code it functions normally and 'results' contains the correct number of throw results and they appear to be random, when I leave the code to run and do exactly the same thing it produces a set…
Matt
  • 4,107
  • 3
  • 29
  • 38
4
votes
7 answers

Dice Question (Full House and Straight recognition)

I'm making a dice game. There are 5 dice in which I have all the values for and I need to determine if they make up a full house (3 of one and 2 of another), small straight (1-4, 2-6 or 3-6) or a large straight (1-5, 2-6). Perhaps the best way to…
Lloyd Powell
  • 18,270
  • 17
  • 87
  • 123
4
votes
1 answer

How calculate the dice coefficient for multi-class segmentation task using Python?

I am wondering how can I calculate the dice coefficient for multi-class segmentation. Here is the script that would calculate the dice coefficient for the binary segmentation task. How can I loop over each class and calculate the dice for each…
AI_NA
  • 336
  • 2
  • 5
  • 20
4
votes
0 answers

My generalized dice loss function, using Keras backend, returns NaN and I do not understand why

I am implementing a code for semantic segmentation using Keras and I wrote my loss function as in the paper "Generalised Dice overlap as a deep learning loss function for highly unbalanced segmentations" (link: https://arxiv.org/abs/1707.03237) to…
4
votes
1 answer

Javascript dice game: How to remove HP depending on dice result?

So I am a beginner about JavaScript and I have to make a dice game. First of all, here are the rules: The player and the monster have 2 dice each. Each dice must be stopped when the user clicks on it (so 4 clicks in total). If the total of the 2…
Ced
  • 1,293
  • 5
  • 23
  • 34
4
votes
2 answers

Show dice element corresponding to random number generated on click

I was trying to make a dice random, and I created different faces of it by using HTML and CSS. Now I cannot hide them. I want to show only one face of the die at a time. How can I call a single face on random numbers from 1 to 6 and in javascript I…
Priyom saha
  • 630
  • 1
  • 9
  • 28
4
votes
2 answers

Java: Rolling two dice until you get a desired sum

I want to write a program where I roll two die, until I get the sum of those dice being 11. I want to record how many "attempts" or rolls of the dice I used by the time I got the sum of 11. My code so far: public class Dice { public static…
Ryan
  • 45
  • 1
  • 5
4
votes
1 answer

Choosing how many dice to roll in JavaScript Dice Roller

I am trying to get my script to allow the user to choose how many dice they would like to roll (1-40) in my input field, with the button onClick() function capturing that input-number and displaying/creating "dice" div's.