Skip to content
← Back to Community
Python dice game
Profile icon
DEMONul1234

Simple dice game with a few simple options.

Voters
Profile icon
DaiwikPatel
Profile icon
dillonjoshua68
Profile icon
DEMONul1234
Comments
hotnewtop
Profile icon
CoolJames1610

Nice, but posted on wrong channel :)

Profile icon
DEMONul1234

@CoolJames1610 Still a newbie on repl, could you tell me where should it be posted then? : )

Profile icon
CoolJames1610

The Share Board :) @DEMONul1234

Profile icon
DEMONul1234

@CoolJames1610 O.K added it on the share board

Profile icon
CoolJames1610
Profile icon
dillonjoshua68

If you’re a beginner... like me... this program is actually very good... and it’s good u invested ur time in doing this.

Just for additional info... if you want to add An animation do this..

import sys (1st line)
import time

def anim(txt):
for x in txt:
print(x, end=‘’)
time.sleep(0.06)
sys.stdout.flush()

That’s the function...

Now to apply it...

Instead of using print do this...

call the function Instead of using print

then take input

anim(“Enter a number from 1-6: “)
variable_name = int(input(“”))

leave the input space empty, but make sure to put quotes (I’m not sure if quotes are needed tho)

Profile icon
dillonjoshua68

Make sure to use indents

Profile icon
dillonjoshua68

Refer to my guessing game program and how I applied it, or my other pinned program

Profile icon
DEMONul1234

@dillonjoshua68 Looks like sth worth considering as I really hadn't thought of animating it before I posted this dice game. Just tried to do sth interesting with Python without really commiting to it, if you get my meaning. Thanks for tip, much appriciated

Profile icon
dillonjoshua68

Btw, make the random.randint(1,6) since a dice has 6 sides @DEMONul1234

Profile icon
DEMONul1234

@dillonjoshua68 oh, totally forgot to put 1 instead of 0, my bad

Profile icon
dillonjoshua68

Additionally, you can import randint without importing random...
from random import randint
@DEMONul1234

Profile icon
DEMONul1234

@dillonjoshua68 Ok, I may make some mistakes as I've recently stared to create programmes by myself after watching many tutorials. Will work over it. In addition, I added (on my profile's programme version) option to create player name, you know, just to make it more...convinient? I guess...

Profile icon
dillonjoshua68

@DEMONul1234 sorry if I offended u.... ☹️.. but hope this helps 🙃😜

Profile icon
DEMONul1234

@dillonjoshua68 You didn't really offend me in any way. Guess I made it sound as if I got offended.

Profile icon
dillonjoshua68

😅😅 ok anyways, let’s continue programming💥 @DEMONul1234

Profile icon
dillonjoshua68

Btw, are u new to programming, python ur first language? Or do u know another lang? @DEMONul1234

Profile icon
DEMONul1234

@dillonjoshua68 Well, I wouldn't consider myself new, but due to personal problems I hadn't had much time to code, which affected my programming. Python has been my 1st language for a year now, I think. Will try to learn ruby and crystal once I'll remember most of Python stuff.

Profile icon
dillonjoshua68

Same dude, I’m currently learning python... I got to know lots about it recently due to repl.it @DEMONul1234 during the summer vacation imma learn python deeper in udemy and also possibly java or c++