Ejemplo n.º 1
0
        //A class to generate the next random number
        private void getNextNumber()
        {
            RNGType rand = new RNGType();

            textBox_number_called.Text = Convert.ToString(rand.getNextUniqueRandomValue(1,
                                                                                        BINGOCARDSIZE * RNGRange, used));
        }
Ejemplo n.º 2
0
 // Driver program to play the game
 //    Initial call with -1 for row and column selection to start game.
 //    Subsequent calls with row and col index selected by player.
 // void playTheGame(int selectedRow, int selectedCol)
 void playTheGame()
 {
     if (countOfCalledNumbers < MAXBINGONUMBER)
     {
         countOfCalledNumbers++;
         nextCalledNumber = RNGObj.getNextUniqueRandomValue(1, MAXBINGONUMBER);
         nextCalledLetter = bingoLetters[(nextCalledNumber - 1) / NUMBERSPERCOLUMN];
         txtRNG.Text      = nextCalledLetter + " " + nextCalledNumber.ToString();
     }
     else
     {
         MessageBox.Show("All bingo numbers called.  \nYou must have missed one or more.  \nGame over.", "All Numbers Used");
         Close();
     }   // end if
 } // end playTheGame
Ejemplo n.º 3
0
        }     // end button clickhandler

        // Method called to get the next bingo number and add previous numbers to the count
        void playTheGame()
        {
            if (countOfCalledNumbers < MAXBINGONUMBER)
            {
                countOfCalledNumbers++;
                nextCalledNumber     = RNGObj.getNextUniqueRandomValue(1, MAXBINGONUMBER);
                nextCalledLetter     = bingoLetters[(nextCalledNumber - 1) / NUMBERSPERCOLUMN];
                txtNumberCalled.Text = nextCalledLetter + " " + nextCalledNumber.ToString();
            }
            else
            {
                MessageBox.Show(userName + ", All numbers have been called. You lose");
                this.Close();
            }
        }