Pascal

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

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Mines-problem! Please help! Posted by blackout9000 on 30 May 2012 at 3:19 PM
Hi! I need help about this task:
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 help!
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
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.