예제 #1
0
        private void SwitchForm()
        {
            FindSampleGame sample = new FindSampleGame();

            sample.Show();
            this.Hide();
        }
예제 #2
0
        // parameterized constructed taking in rows, columns and form as parameters
        public ScanAnalyzer(int a, int b, FindSampleGame form)
        {
            rows    = a;
            columns = b;

            sample1 = new int[2];            // Sample 1 holds the random location of the first item
            sample2 = new int[2];            // Sample 2 holds the random location of the first item

            sample1[0]   = rand.Next(0, a);  // random integer for sample 1 = row
            sample1[1]   = rand.Next(0, b);  // random integer for sample 1 = row
            sample2[0]   = rand.Next(0, a);  // random integer for sample 2 = row
            sample2[1]   = rand.Next(0, b);  // random integer for sample 2 = column
            guessCounter = 0;                // Initializing the guess counter to 0

            grid = new string[a, b];         // Initializng the array named grid
            ResetGrid();                     // Resets the  array back
            this.form       = form;          // Playing the game of a form which is set here
            form.AppearGrid = DisplayGrid(); // // Displays the matrix in the textbox
        }