- Update by right-clicking (control-click on Mac) the main project in the package explorer, drag down to Team... and click Update.
- You should see a lab3 package in the labs source folder.
Note and warning: It is very easy to find a solution to this problem in the Internet. This course does not have as one of its goals making you an expert on finding solutions on the Internet. The goal is to teach you the basic concepts of computer science and programming.You are not allowed to copy any code for your solution to this problem! The solution takes some 30 lines of code, so we are not asking you to write an air-traffic controller.
However, even these 30 lines may be difficult for you to write at first. So, get help from a TA or the professor, come to office and TA hours, but do this work on your own so that you learn the material.
Be assured that you will not do well on the exam if you do not understand this material.
You may find the exercise online here, as Creative Exercise 30.
Do not change that part of the file. The file is very clear about where you are to insert your code.
You must use the * and . characters as shown in the book. Otherwise, the visual version of this game (described below) will not work correctly.The example given in the book is reproduced below:Your output must include both the left and right parts of each line as described below.
* * . . . * * 1 0 0 . . . . . 3 3 2 0 0 . * . . . 1 * 1 0 0You must produce output that matches the form you see above:
For example:
The book provides a nice hint about an implementation that eliminates special cases around the edges of the field.
Test on very small (say, 3x2) mine fields at first. Enlarge the fields and test again, making certain the output is correct.Are you sure your output is correct?
Make sure it includes both the left and right parts of each line as described above.
The output you produce is therefore the interface between:That class-provided code has tried to be tolerant of the output you might produce. If it is not working for you, let us know.
- Your code that computes the maze, in particular, the location of bombs, and
- The class-provided code that runs the visual version of the game.
To play the visual version of the game:
- Right-click on squares where you think there is a bomb.
- Left-click on a square that has no bomb to show you the count of the number of bombs that border that square.
When you done with this lab, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches