Question: Implement in Java with a GUI the game Minesweeper with the following restrictions: 1. Board size: you should give the option to the user to

Implement in Java with a GUI the game Minesweeper with the following restrictions:

1. Board size: you should give the option to the user to choose at the start of the game between "Beginner", "Intermediate" and "Advanced". The board size and number of mines for each of these three choices are the following: Beginner: board 8x8 and 10 mines, Advanced: board 16x16 and 36 mines and finally Expert: board 24x24 and 91 mines

2. your game should have a timer that displays the number of seconds played so far, if the clock reaches 1 minute for Beginner, 3 minutes for Advanced or 10 minutes for Expert then the game is lost and the mines should explode

3. Implement some small animation of mines exploding and at the same time the game should also make an exploding sound. Obviously only the not yet uncovered mines should explode,the ones that were marked as mines should not explode. Furthermore your program should point out with a red X the locations where the player marked as mine and were not correct.

4. the control of the game should be done completely by mouse clicks: left click uncovers that location, right click marks as mine in that location, a second right click erases the mine marking for that location

5. BONUS for +2p a second click on a revealed location that has the number of mines adjacent to it marked will uncover automatically all the cells adjacent that are supposed to not have any mines.

As an example of what you should implement try this implementation of minesweeper: http://www.freeminesweeper.org/minecore.html

=-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Program 2

OVERVIEW

Write a program to convert roman numerals into their arabic equivalent.

INPUT REQUIREMENTS

Read one or more roman numerals from standard input. Process one line at a time. Each input line contains only one roman numeral, starting in column one. Assume there are no embedded blanks.

OUTPUT REQUIREMENTS

The arabic equivalent of each input roman numeral is displayed on standard output, starting in column one.

FUNCTIONAL REQUIREMENTS

Here are the arabic equivalents for roman symbols:

The "basic" roman symbols The "auxiliary" roman symbols

I X C M V L D

1 10 100 1000 5 50 500

Convert the roman numeral to arabic processing the symbols from left to right according to the following rules:

1. A symbol following one of greater or equal value adds to its value. (E.g., XII = 12) 2. A symbol preceding one of greater value subtracts its value.(E.g., IV = 4; XL = 40)

ERROR HANDLING REQUIREMENTS

In each of the error conditions below, display the given message and skip the numeral and continue processing the next line.

"Invalid character in input. Valid characters are I,V,X,L,C,D,M."

Only the listed characters (upper case) are valid.

"Invalid numeral: can't subtract auxiliary symbol."

It is not permitted to subtract an "auxiliary" symbol. (CML, not LM = 950; XLV not VL, = 45).

"Invalid numeral: two consecutive subtractions."

Can't do two subtractions in a row, thus LIVX is illegal.

"Invalid numeral: additions don't decrease."

Additions must decrease, as you go from left to right. Thus, each symbol added must have a value equal or less than the last symbol which was added. Thus, LIIX is wrong, cause we added L, added I, subtracted I, then try to add X.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!