fork(1) download
  1. # last version ( 143 )
  2. for(($n,$r,$c,@m)=<>;$n--;map{shift@x;s#(\.)|.#(grep'*'eq$x[$r-$_/3][$-[0]+$_%3-1],-2..6)-3&~!$1?'.':'*'#eg}@m){@x=(map[(/./g)x2],@m)x3}print@m
  3. # inspired by "mine sweeper" ( 145 )
  4. #for(($n,$r,$c,@m,$")=<>;$n--;map{shift@x;s#(\.)|.#($`.aa.($/x($c-3).fff)x3&"@x[$r-2..$r]"x2)=~y/"//-3&~!$1?'.':'*'#eg}@m){chop(@x=(@m)x3)}print@m
Success #stdin #stdout 0.62s 6308KB
stdin
30
40
35
...*.............*.*............*..
.....*.*...***......**......*......
**..........*..........*..*...**.**
...*...*...*.........*......**.*...
...*..*.......*.....**.*........**.
.**........**....*.......*......*..
...........*..*..*...*..*.......***
...*....*..............*......**...
.....*........*.*...*...*..**..*.*.
.....*.............*........*....**
....*......*.*..*..*.....*...*.....
........*.....*...*........*...*...
*...............*......*.*..****...
.*........*...**............*......
*..**...**.*......*.............**.
...*..*...*...**..*.........**.*...
......**........*.............**...
.***..*.*....*..***...**...........
.....*...**........................
..*...**........*.....*...*....**..
*....*....*....**..*........*......
........*....*****......*......*.**
........................*...*..**.*
*...*.....*..*......**....***....**
.....**......*......**.*........*.*
.*....*.*............*.*...........
.*......*.**...**................**
.......**.*...*...*..*....*..*..**.
....**..*...*...*..*......*..*.....
......*....*...*.*.*...............
..**.*..**........*.........*...*.*
....*..*.....*.**.............*.*..
...*..*.*..*..*.**..**..*......*...
..****.*....**.......*.........*.*.
.**.*......**.*....*.*..**.**...*..
........**..............*....*..*.*
..*...*.*....*...*..*.......*......
...**...**....*.*.*.***.*.*........
*..*....***.*...*..........*....*..
....*......*..*.......*...*..*.*...
stdout
**.....**......*..*.........*.....*
***.........................*.....*
.**...............................*
...............***..........*..*...
...........*...*............***....
..........**.......................
..........**..***..................
............*..**..................
............*..**..................
.............*.*...................
.............*.*...................
.............*.*...................
.**..........*.*...................
..............*....................
...................................
.................................**
.................................**
...................................
...................................
.......***.........................
.......*....................**.....
.......***..**.......**....*..*....
....................*.**..*........
..............*......*..*.*........
............*..*.....*..*.*........
...........**.**.......**....*.****
............*.*........*..***.***.*
...*.........*..........*.*..**....
...*.***...............**.....*....
........*...............*.****.....
.....*...................****......
.....*....................*........
......*...*........................
........*.*........................
.........*..................**.....
...........................*..*....
................*..........**.**...
....*..**......*.*..........*.**..*
.........*.....*...........**..*.**
....*....*.......**.........*...*..