Table of Contents

Review of Java Basics, IDEs, Intro to Two-Dimensional Arrays


Review of Java Basics (with an intro to IDEs)

Lab Activity: Run bluej and try editing, compiling and running Java programs


Introduction to Two-Dimensional Arrays

           *****
           *   *
           *****

Example Application of Two-Dimensional Arrays: Minesweeper

                          :)
  
                1  2  3  4  5  6  7  8  9
               -- -- -- -- -- -- -- -- --
           1 |  -  -  -  -  -  -  -  -  -
           2 |  -  -  -  -  -  -  -  -  -
           3 |  -  -  -  -  -  -  -  -  -
           4 |  -  -  -  -  -  -  -  -  -
           5 |  -  -  -  -  -  -  -  -  -
           6 |  -  -  -  -  -  -  -  -  -
           7 |  -  -  -  -  -  -  -  -  -
           8 |  -  -  -  -  -  -  -  -  -
           9 |  -  -  -  -  -  -  -  -  -
  
         Enter a command to perform, where command is one of:
  
              'o' to open a square
              'f' to mark a square with a flag (F)
              '?' to mark a square with a question mark (?)
              'c' to clear a square
              'q' to quit the game
  
         Enter a command ( <o,f,?,c,q> ): o
  
         Enter row & column coordinates of square separated by a space: 2 2
  
                          :)
  
                1  2  3  4  5  6  7  8  9
               -- -- -- -- -- -- -- -- --
           1 |  -  -  -  -  -  -  -  -  -
           2 |  -  4  -  -  -  -  -  -  -
           3 |  -  -  -  -  -  -  -  -  -
           4 |  -  -  -  -  -  -  -  -  -
           5 |  -  -  -  -  -  -  -  -  -
           6 |  -  -  -  -  -  -  -  -  -
           7 |  -  -  -  -  -  -  -  -  -
           8 |  -  -  -  -  -  -  -  -  -
           9 |  -  -  -  -  -  -  -  -  -