Application for minesweeper, JAVA Programming

This program will help you start doing GUI programming, and is a good example of 2D arrays. Mine Sweeper is a classic game that is played on a 2D grid of cells. At the beginning of the game, all of the cells are "covered", and some of them have mines in them. The goal of the player is to uncover all of the cells that are not mines without detonating a mine. This happens when the player tries to uncover a cell with a mine in it.

Instructions:

1. Write GUI application that plays the game of mine sweeper. One way to do this would be to have the main application extend JFrame. The cells of the mine field could then be JButtons in a Grid layout.

2. A cell should exist in two states, covered and uncovered. In the "covered" state, the cell is blank. In the "uncovered" state, a "mine" cell shows an asterisk (*), or a picture of a mine. An uncovered "clear" cell displays the number of neighbor cells that are mines (or is blank if there are no neighboring mines).

3. Left clicking on a covered cell uncovers it.

4. Right clicking on a covered cell toggles a flag indicating that the user thinks there is a mine in that location.

5. When the user uncovers a clear cell that has no neighboring mines, all of it's neighbors are also uncovered. If any of the neighbors have no neighboring mines, their neighbors are uncovered as well, and so on.

6. If the user tries to uncover a mine cell, the mine explodes, and the player loses the game.

7. Optional: Use images to indicate mines, and flags. Make some kind of explosion special effect. Allow the user to restart the game after winning or losing. Allow the user to specify the size of the minefield, and the number of mines in it.

Assignment checklist:

  • Write a mine sweeper program.
  • Make sure the program compiles and runs from the command line without modification.
  • Include your source, executable files and report in your turnin.
  • Zip all of your files in a SINGLE .zip file and turn it in to the D2L dropbox.
Posted Date: 2/19/2013 7:31:06 AM | Location : United States







Related Discussions:- Application for minesweeper, Assignment Help, Ask Question on Application for minesweeper, Get Answer, Expert's Help, Application for minesweeper Discussions

Write discussion on Application for minesweeper
Your posts are moderated
Related Questions
Validate() : Used to validate properties after they have been populated; known as before FormBean is handed to Action. Returns a collection of ActionError as ActionErrors. Followin

Use of WebLogic Platform in Project: Technologies Tools: Weblogic 8.1, Solaris 9, MQ Series 6.0, iplanet 6.1, Mercury Test Director. Project Overview: Wellington Manag

What is java Bytecode Java programs (Source code) are compiled into a form known as Java bytecodes. Java compiler reads Java language source (.java) files, translates source

Exercise 1) Lets start by query example in SPARQL: QUERY: What are the school's names that belong to the "local authority district" 00AA? NOTE 1: "Authority districts" divide UK i

The purpose of this assignment is to give you practice working with one dimensional arrays. It will also introduce you to one of the oldest mathematical algorithms in the world. No

What are separators in java? Separators help elaborates the structure of a program. The separators used within HelloWorld are parentheses, ( ) , braces, { } , the period, .

You are to write two versions of this assignment. One using HTML and VBScript and one using HTML and Javascript. In both, you are to create an HTML webpage that: performs simple

What is the difference between method overriding and overloading? Overriding is a method with the same name and arguments as in a parent, whereas overloading is the same met

Problem 1) Describe the concept of interfaces in Java with a suitable example for the same Explanation of the concept of interfaces with example 2) Describe the Inp

RMI is a set of APIs that permits to build distributed applications. RMI uses interfaces to explain remote objects to turn local method invocations into remote method invocations.