MineSweeperProblem code: DPC103 |
Have you ever played Minesweeper? It s a cute little game which comes within a certain Operating System which name we can t really remember. Well, the goal of the game is to find where are all the mines within a MxN field. To help you, the game shows a number in a square which tells you how many mines there are adjacent to that square. For instance, suppose the following 4x4 field with 2 mines (which are represented by an * character):
*
.
.*..
.
If we would represent the same field placing the hint numbers described above, we would end up with:
*100
2210
1*10
1110
As you may have already notice, each square may have at most 8 adjacent squares.
Input:
The input will consist of an arbitrary number of fields. The first line of each field contains two integers n and m (0<n, m<=100) which stands for the number of lines and columns of the field. Each safe square is represented by an . Character (without the quotes) and each mine is represented by an * character (without the quotes). The first field line where n=m=0 represents the end of input and should not be processed.
Output:
For each field, you must print the following message in a line alone:
Field #x:
Where x stands for the number of the field (starting from 1). The next n lines should contain the field with the . Characters replaced by the number of adjacent mines to that square. There must be an empty line between field outputs.
Sample Input
4 4
*
.
.*..
.
0 0
Sample Output
Field #1:
*100
2210
1*10
1110
| Author: | rushikesh30 |
| Date Added: | 25-02-2010 |
| Time Limit: | 10 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, C99 strict, CLOJ, CPP 4.0.0-8, CPP 4.3.2, CS2, F#, GO, JAVA, JS, PERL6, PYTH 3.1.2, TEXT |
Comments

Fetching successful submissions

where should i register for
where should i register for this contest ??????????//
I am the Organizer. This
I am the Organizer.
This contest is a part of Tech-Days2010 and Microsoft DreamSpark Yatra organized by Microsoft Student Partner India Team and supported by Microsoft Academia Team.
Our UnderConstruction WebSite is at www.tech-days2010.com
Moreover when you are
Moreover when you are registering at http://bit.ly/RegisterDevCon , you need not pay if you are attending only online Events. But registration is compulsory to get prizes and Certis.
is the input in the above
is the input in the above example correct?
isn't should be
*...
....
.*..
....
yes the input should be what
yes the input should be what you wrote..Assume that its there in the test data..
is there a space btn Field n
is there a space btn Field n #
and should there b a space after every Field # output
I am very well aware that
I am very well aware that this kind of requests are not entertained but since I am getting "wrong answer" can I have a few more testcases to test where my code is going worng?
Special Thanks to Rushikesh
Special Thanks to
Rushikesh Deshpande (ISMU Dhanbad); Shahzor Khan(BIT Mesra); Kunal Jain(IIIT Hyderabad); Gourab Mitra(MSP BIT Mesra); Subhradip Saha(MSTC BIT Mesra)
@ankit_ankit I really
@ankit_ankit I really appreciate your dedication. Keep trying until you succeed! :)
@vishal thanx
@vishal
thanx
@Kunal You are the first one
@Kunal You are the first one to solve all 7 questions.
@Dan Congrats to you too!
@ALL Please mail your
@ALL
Please mail your CodeChef ID, your name, your Institutions Name, Your Address(Where you want Posters, Certis, Goodies to be delivered, (No. of deliveries will depend on our budget)) to dreamsparkyatra@gmail.com For Updates follow http://twitter.com/dreamsparkyatra .
Happy Holi and Happy Coding!
@ALL Please mail your
@ALL
Please mail your CodeChef ID, your name, your Institutions Name, Your Address(Where you want Posters, Certis, Goodies to be delivered, (No. of deliveries will depend on our budget)) to dreamsparkyatra@gmail.com For Updates follow http://twitter.com/dreamsparkyatra .
Happy Holi and Happy Coding!
@All You can mail after the
@All
You can mail after the CONTEST!
@All Check out the DreamSpark
@All
Check out the DreamSpark Professional Programming Contest #2 on 13th March 18:00 hours IST. We will send Posters to Participants by Post to promote the Contest Series. We'll also Send Participation E-Certis.
i need asource for this code
i need asource for this code minesweeper