Java program to play minesweeper , JAVA Programming

Assignment Help:

Project Requirements

  1. Write and test a Java program to play Minesweeper using Model-View-Presenter design (The model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
  2. The view is an interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.
  3. The presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.)

This project is divided into three tiers. You must complete one tier before beginning the next.

Tier 1
Implement the basic Minesweeper functionality:

1. Determine the neighbor count (i.e., for each cell, count the number of neighbors that are mines).

2. If the user selects a cell that is blank (i.e., no mines as neighbors) show all eight cells immediately surrounding the selected cell. If the selected cell is near an edge, be sure not go out of bounds.

3. If the user selects a cell that is non-blank (i.e., mines as neighbors), display only that cell number.

4. When all non-mine cells have been selected, display a JOptionPane message showing that the user has won.

5. When a mine cell is selected, show a JOptionPane message that indicates the user lost.

6. For this tier, your main method may hard-code the size of the board; but your GUI and your game engine should not make assumptions about the board size.

7. The game board should show the location of the mines. (This makes your project much easier to grade.)

Tier 2
Make the game more complete and give the user more options:

1. Allow the user to specify the number of mines and size of the board to be used. There are several ways you can do this.
o Use command-line parameters
o Create a new dialog window
o Use JOptionPane.showInputDialog
Be sure to perform bounds checking on the user input. The game should not crash if the user specifies a board size of "-6 x tomorrow".

2. Allow the user to flag cells. You may use any reasonable mechanism to flag cells.

3. Allow the user to show or hide the location of the mines. (In other words, give the game a "real game" mode and an "instructor demo" mode.)

Tier 3
Make the game fully operational:

1. If the selected cell is blank, show all blank cells connected to the current cell. (This task will be demonstrated in class and shown using the online Minesweeper games.)

2. Use the right mouse click to flag a cell. Suggestion: use a search engine with the following search words: Java right click.


Related Discussions:- Java program to play minesweeper

Create an application for Koch’s Cottages, Create an application for Koch’s...

Create an application for Koch’s Cottages, a weekend getaway resort that rents cottages and boats to use on the local lakenimum 100 words accepted#

Develop an employee application, Employee application Project Descriptio...

Employee application Project Description: Subsequent Technology should be used 1) UI (jsp, jstl ,html, etc) 2) Framework (Spring MVC and hibernate) 3) Database (MYSQ

What does it mean that a method or field is static, What does it mean that ...

What does it mean that a method or field is "static"? Static variables and methods are instantiated only once per class. In other words they are class variables, not example va

Minimum spanning tree based heuristic, Problem description: A travelling s...

Problem description: A travelling salesman wants to make a tour of the cities and returns back to the starting point. What is the minimum length tour? Formal Definiti

Why we avoiding short circuits, Why we Avoiding Short Circuits ? If you...

Why we Avoiding Short Circuits ? If you need all of your boolean expressions evaluated regardless of the truth value of each, then you can use & and | instead of && and ||. The

Saaa, Write a program to find the area under the curve y = f(x) between x =...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

Multithreading and networking, This assignment has two main objectives. It ...

This assignment has two main objectives. It aims to establish a basic familiarity with the Java API (Java Thread class) for creating multithreaded Java application, and the Java ne

Project, Prog. Concepts - Project The objective is to implement a menu - ba...

Prog. Concepts - Project The objective is to implement a menu - based system for Bank Accounts in order to simulate a very simple banking system. Many structures have to be declare

Relate in brief - microsoft vs java, Relate in brief - Microsoft vs Java ...

Relate in brief - Microsoft vs Java Microsoft hates Java, as a Java program (portable) isn't tied to any particular operating system. If Java is popular, then programs written

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd