## Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only

Mines-problem! Please help! Posted by blackout9000 on 30 May 2012 at 3:28 PM
Before entering the minefield, you are given a matrix 'b' filled with integers where every b[i,j] of them stands for a number of mines around (not includig) the a[i,j] part of the minefield.
The matrix' are NxN where N is a given integer N>=5.
The task is to write matrix 'a' that represents the minefield (if there is a mine then '*' else 's') so you could cross the minefield safely.

example
Input:
5
2 3 4 3 1
3 4 5 4 3
1 3 5 4 3
1 1 2 2 3
0 0 1 1 1

Output:
s * * s s
s * * * s
* s s * *
s s s * s

I've been trying to solve it for days but I can't!
Please use only pascal.
Thanks!!!

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic