Share your repls and programming experiences

← Back to all posts
Dice Roller
LightninMcQuade (241)

https://repl.it/@QuadeG1/Dice-Roller
I built this last semester it can be used in place of dice for any board game!

Commentshotnewtop
mmcdermotttcsp (19)

wow nice I might just fork this!

AdamW1 (0)

dude NICE i needed this

Jeremiah32556 (1)

I LOVE THIS THING MAN

HunterW1 (7)

QUADOOOOOOOOOOOO

[deleted]

lit

HaydenC1 (0)

Dude this is great

JaredH1 (0)

Best dice roller

EthanM444 (1)

This is the most useful program on this website!!!

PrestonG1 (3)

I don't know how I could do anything without this code

EliasG (0)

this makes me a happy boi

JaredH1 (0)

Best Classroom in a highschool programming class ever!

DylanM1 (0)

@quadeg1: ur so good you could get scholarshipos!dsfjdsj!

BarryBBenson (0)

this makes my jazz into S M O O T H J A Z Z

ScottyThePilot (2)

It breaks with 0 sides

glendog (0)

Would using an array to store the dice improve this?

LightninMcQuade (241)

@glendog: Good idea! can expand on that a little?

glendog (0)

@quadeg1: I just mean to introduce new concepts for newer users.

So, something like this:

https://repl.it/@glendog/ListExample

That's very basic to what your program does, but was just something quick to introduce the concept of lists/arrays.

LightninMcQuade (241)

@glendog: That's great! do you mind if I implement this in?

DanielC5th (79)

Maybe try having it display the value of each dice, not just the sum of the all the dice.

Geminisun (1)

This is really cool, and works well. Just one question: would it be possible to make it so that you could see the result of the individual die, as well as the result of them?

LightninMcQuade (241)

@geminisun: Working on it now! check my profile...

DanielC5th (79)

Try adding an error statement or print invalid input when someone enters something other than roll, instead of having the average from the last roll print. again.

Tiger100 (0)

It says sides is not defined on line 12

DanielC5th (79)

@quadeg1: You are giving sides a value inside a definition. You need to give it a value outside of a definition.

LightninMcQuade (241)

done fixing definition didn't work out :( colors did though ;)

DanielC5th (79)

@quadeg1: What part of it did't work out? Also, do you have to import anything to use the different colored text?

LightninMcQuade (241)

@danielc5th: creating a definition didn't and nope I used ANSI color codes

sorenp5 (0)

quad you're falling behind