We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Simulation of a dice | Forum

Topic location: Forum home » Support » General Questions
John
John Jun 8 '23

Hello

I want to simulate a dice, but the tricky part is that i want to stop it after a user defined number (between 1-6) appears a user defined number in a row. Does anybody know how i should do this?

 

I hope it make sense

 

Norman Fallan
Norman Fallan Jun 8 '23
What have you tried so far and where are you stuck?

You know this forum is not intended to solve your homework!
Elijah Black
Elijah Black Jun 8 '23
Simulating a dice with a stop condition? Sounds cool! You can totally achieve that using some programming skills. Here's an idea: start by generating a random number between 1-6, just like a regular dice. Then, keep track of the consecutive occurrences of the user-defined number. Once it hits the desired number of times in a row, you can stop the simulation.
By the way, if you're not into coding or want a quick solution, you can check out this awesome free online dice rolling website I found. It has a dice roller where you can choose the number of sides and roll away to your heart's content.
The Forum post is edited by Elijah Black Jun 8 '23