Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M9523007

Have any Question?


Related Questions in Java

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As