C# Dice Roll Program With Images

Discussion in 'C#' started by Pylons, Feb 29, 2012.

  1. Pylons

    Pylons New Member

    Joined:
    Feb 29, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi, i am trying my best to do this program which is to make a program that lets the user to roll two dices as many as it wants, but the dices rolled can not be shown as numbers but as a image.
    such as
    _____________
    l O O l
    l O O l
    l___O___ O__ l
    for a dice roll of 6.

    i havent made the loop code for the program yet and i only know how to make the random numbers for the rolls, i just can't figure out how to make the arraylist for the images and make the code to actually use the images instead of numbers... if you know what i mean.

    here is my code so far, thanks for the help!

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace DiceRoll_game
    {
        class Diceroll
        {
            static void Main(string[] args)
            {
                
                int[] DiceUno = new int[6];
                int[] DiceDos = new int[6];
                Random rnd = new Random();
    
                Console.WriteLine("This program will allow you to roll two dices");
                Console.WriteLine("\nAs many times as you want");
                Console.WriteLine("\n\nWhen you want to exit the program, please type (exit)");
                Console.WriteLine("\nPress any key to begin rolling");
                Console.Read();
                
    
                for (int i = 0; i < 1; i++)
                {
                    int diceRoll = 0;
                    diceRoll = rnd.Next(6);
                    DiceUno[diceRoll]++;
                    Console.WriteLine("Dice 1 is rolled a: {0}", diceRoll + 1);
                    diceRoll = rnd.Next(6);
                    DiceDos[diceRoll]++;
                    Console.WriteLine("Dice 2 is rolled a: {0}", diceRoll + 1);
                   
                }
    
    
    
    
                
            }
        }
    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice