Qbasicnews.com

Full Version: Looking for help with Dice Roll Program.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well, I dont have the program done yet. I have the outlines for the dice done and the coordinates for the circles and colors of one of the dice done but i ran into a problem. Instead of putting in Subrutines i decided to make the outcome on the dice using IF THEN statements.
ex.
x = (RND * 5) + 1
IF x = 1 THEN
CIRCLE (175, 235), 20 'circle4
PAINT (175, 235), 1, 4 'circle4 color
END IF
end ex.
Except, when i run the program no dots show up. And i havent been able to find anything thats causing them to not show up yet.
Im going to paste my code up here so if anyone could take a look and tell me me if they see whats causing the dots to not show up plz post back and tell me, thanks.

SCREEN 12

RANDOMIZE TIMER
CLS
COLOR 4
LINE (40, 100)-(310, 100) 'Dice Border
LINE (40, 370)-(310, 370) 'Dice Border
LINE (40, 100)-(40, 370) 'Dice Border
LINE (310, 100)-(310, 370) 'Dice Border
'end of dice1
LINE (330, 100)-(600, 100) 'Dice Border
LINE (330, 370)-(600, 370) 'Dice Border
LINE (330, 100)-(330, 370) 'Dice Border
LINE (600, 100)-(600, 370) 'Dice Border
'end of dice2
'CIRCLE (95, 150), 20 'circle1 'Just for Copy Paste
'PAINT (95, 150), 1, 4 'circle1 color 'Just for Copy Paste
'CIRCLE (175, 150), 20 'circle2 'Just for Copy Paste
'PAINT (175, 150), 1, 4 'circle2 color 'Just for Copy Paste
'CIRCLE (255, 150), 20 'circle3 'Just for Copy Paste
'PAINT (255, 150), 1, 4 'circle3 color 'Just for Copy Paste
'CIRCLE (175, 235), 20 'circle4 'Just for Copy Paste
'PAINT (175, 235), 1, 4 'circle4 color 'Just for Copy Paste
'CIRCLE (95, 320), 20 'circle5 'Just for Copy Paste
'PAINT (95, 320), 1, 4 'circle5 color 'Just for Copy Paste
'CIRCLE (175, 320), 20 'circle6 'Just for Copy Paste
'PAINT (175, 320), 1, 4 'circle6 color 'Just for Copy Paste
'CIRCLE (255, 320), 20 'circle7 'Just for Copy Paste
'PAINT (255, 320), 1, 4 'circle7 color 'Just for Copy Paste
IF x = 1 THEN
CIRCLE (175, 235), 20 'circle4
PAINT (175, 235), 1, 4 'circle4 color
END IF
IF x = 2 THEN
CIRCLE (95, 150), 20 'circle1
PAINT (95, 150), 1, 4 'circle1 color
CIRCLE (255, 320), 20 'circle7
PAINT (255, 320), 1, 4 'circle7 color
END IF
IF x = 3 THEN
CIRCLE (95, 150), 20 'circle1
PAINT (95, 150), 1, 4 'circle1 color
CIRCLE (175, 235), 20 'circle4
PAINT (175, 235), 1, 4 'circle4 color
CIRCLE (255, 320), 20 'circle7
PAINT (255, 320), 1, 4 'circle7 color
END IF
END

Any Feedback is welcome, Thanks.
RND produces a decimal number. you need
INT(RND * 5) + 1

:-)
Ohhh, Thanks for your help.