Exemplo n.º 1
0
        } // end convertCharToInt

        // puts the game into motion, checks if the user has a bingo before executing IF there have been more than 3 numbers called
        // (can't have bingo if only three numbers were called)
        public void playTheGame()
        {
            if (countOfCalledNumbers >= 4)
            {
                if (internalCardRep2DArray.checkForBingo())
                {
                    userWins();
                    return;
                }
            }

            // gets the number called from the RNGType Class
            RNGType random = new RNGType();

            nextCalledNumber = random.callNumber();
            int letter = random.getLetterCol(nextCalledNumber);

            nextCalledLetter = bingoLetters[letter];

            String called = String.Concat(nextCalledLetter, nextCalledNumber);

            // shows the number called to the user
            txtNumberCalled.Text = called;
            countOfCalledNumbers++;
        }
Exemplo n.º 2
0
        // method that checks if the user has the number that was called, returns true if they do, false if they don't
        public bool checkIfHas()
        {
            int     column = 0;
            RNGType random = new RNGType();

            column = random.getLetterCol(nextCalledNumber);

            for (int i = 0; i < 5; i++)
            {
                if (this.newButton[i, column].Text != "Free \n Space")
                {
                    if (nextCalledNumber == Int32.Parse(this.newButton[i, column].Text))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }