Click here to Skip to main content
15,886,519 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to check passwords are already exists? Pin
Expert Coming14-Mar-09 21:11
Expert Coming14-Mar-09 21:11 
AnswerRe: How to check passwords are already exists? Pin
Eddy Vluggen15-Mar-09 2:46
professionalEddy Vluggen15-Mar-09 2:46 
QuestionA pointer as an argument ! Pin
Mohammad Dayyan14-Mar-09 20:22
Mohammad Dayyan14-Mar-09 20:22 
AnswerRe: A pointer as an argument ! Pin
Expert Coming14-Mar-09 21:14
Expert Coming14-Mar-09 21:14 
GeneralRe: A pointer as an argument ! Pin
Mohammad Dayyan14-Mar-09 21:21
Mohammad Dayyan14-Mar-09 21:21 
QuestionEnable Run ActiveX in web browser Pin
jsezar14-Mar-09 18:54
jsezar14-Mar-09 18:54 
QuestionHow to fire the list of AutoComplete in TextBox when it clicked, without enter any text Pin
12Code14-Mar-09 18:26
12Code14-Mar-09 18:26 
Questionrandom seeds? Pin
antrock10114-Mar-09 18:02
antrock10114-Mar-09 18:02 
hi there, im new to the forums. Im creating a dice game. however my attack logic is some what flawed. I was having trouble with random numbers generating the same number so i placed them inside there own class hoping it would then generate diffrently. however now the same number generates eg 66 + 66. this is a rather pain as my whole game will contain about 7 randoms.All being called ont he same button.Another problem im having (///////second code///////) Where the random only generates and pulls up if (dilemma == 1). Just a note im fairly new to c# so if you could explain any fixes you come up with i'd really appreciate it.

regards ant

public class Globals4
    {
    public static int user;
    public static Random uc = new Random();
    }

public class Globals3
    {
    public static int comp;
    public static Random cc = new Random();
    }


lblwarning.Text = "Warning";
                MessageBox.Show("personal attack");
                int userresult = Globals4.user + Globals.army;
                Globals3.comp = Globals3.cc.Next(1, 100);
                Globals4.user = Globals4.uc.Next(1, 100);
                Globals4.user = Globals4.user + Globals.army;
                MessageBox.Show("Computer rolled " + Globals3.comp + " You rolled " + Globals4.user + " with an army strength of " + Globals.army + " equals " + userresult + "");

//////////////////////////////SECOND CODE//////////////////////////////////////
dilemma = dl.Next(1, 1);
            DialogResult res;
            if (dilemma == 1)
            {

                res = MessageBox.Show("marriage", "Dilemma", MessageBoxButtons.YesNo);
                if (res == DialogResult.Yes)
                {
                    Globals.notoriety -= 1;
                }
                else if (res == DialogResult.No)
                {
                    Globals.notoriety += 1;
                }

                if (Dilema == 2)
                {

                    res = MessageBox.Show(" force?", "check", MessageBoxButtons.YesNo);
                    if (res == DialogResult.Yes)
                    {
                        Globals.notoriety -= 1;
                    }
                    else if (res == DialogResult.No)
                    {
                        Globals.notoriety += 1;
                    }



//EDIT i forgot to add this is c# visual i believe its called .net (not the console)
AnswerRe: random seeds? Pin
Eslam Afifi14-Mar-09 19:34
Eslam Afifi14-Mar-09 19:34 
GeneralRe: random seeds? Pin
antrock10114-Mar-09 20:30
antrock10114-Mar-09 20:30 
AnswerRe: random seeds? Pin
Alan N15-Mar-09 1:17
Alan N15-Mar-09 1:17 
GeneralRe: random seeds? Pin
antrock10115-Mar-09 11:17
antrock10115-Mar-09 11:17 
GeneralRe: random seeds? Pin
Alan N15-Mar-09 13:40
Alan N15-Mar-09 13:40 
AnswerRe: random seeds? Pin
makumazan8415-Mar-09 2:27
makumazan8415-Mar-09 2:27 
GeneralRe: random seeds? Pin
antrock10115-Mar-09 11:28
antrock10115-Mar-09 11:28 
GeneralRe: random seeds? Pin
antrock10116-Mar-09 8:41
antrock10116-Mar-09 8:41 
GeneralRe: random seeds? Pin
antrock10116-Mar-09 14:16
antrock10116-Mar-09 14:16 
GeneralRe: random seeds? Pin
antrock10118-Mar-09 17:22
antrock10118-Mar-09 17:22 
QuestionSQL statement problem? Pin
Jon Henry14-Mar-09 11:43
Jon Henry14-Mar-09 11:43 
AnswerRe: SQL statement problem? Pin
Christian Graus14-Mar-09 11:45
protectorChristian Graus14-Mar-09 11:45 
Question[Message Deleted] Pin
jetspike14-Mar-09 10:49
jetspike14-Mar-09 10:49 
GeneralRe: Accessing datatable.rows on Form1 from From2 Pin
Luc Pattyn14-Mar-09 11:19
sitebuilderLuc Pattyn14-Mar-09 11:19 
AnswerRe: Accessing datatable.rows on Form1 from From2 Pin
Christian Graus14-Mar-09 11:51
protectorChristian Graus14-Mar-09 11:51 
QuestionImage Problem Pin
reza assar14-Mar-09 9:20
reza assar14-Mar-09 9:20 
AnswerRe: Image Problem Pin
Christian Graus14-Mar-09 9:31
protectorChristian Graus14-Mar-09 9:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.