2 added 475 characters in body
source | link

Matlab, 120120 111 bytes

f=inputfunction f=c(''f);c=@(x,i)conv2(x+0,ones(i),'s');a=c(f<34,3);n=a;for;for k=f;a=c(a&f==64a&f<65,3)|a;a=c(a&f>99,5)|a;end;f(a)='-';disp(f)'

Convolution is the key to success.

The idea is following: Find the active bomb. Enlarge this area to a 3x3 square. Find new affected bombs, enlarge the correspoding areas to the corresponding size and add those to the previously destroyed area. Repeat this enough times (in my case as many times as we have input characters, just because that is the shortest variant) to be sure that we reached a stationary point (=no more exploding bombs). Then set all the destroyed area to - and display the result.

The input is assumed to be a matrix of characters, e.g.

['!XXXXXXXX';
'X@XXXXXXX';
'XX@XXXXXX';
'XXX@XXXXX';
'XXXX@XXXX';
'XXXXX@XXX';
'XXXXXX@XX';
'XXXXXXX@X';
'XXXXXXXX@'];

Matlab, 120 bytes

f=input('');c=@(x,i)conv2(x+0,ones(i),'s');a=c(f<34,3);n=a;for k=f;a=c(a&f==64,3)|a;a=c(a&f>99,5)|a;end;f(a)='-';disp(f)

Convolution is the key to success.

The input is assumed to be a matrix of characters, e.g.

['!XXXXXXXX';
'X@XXXXXXX';
'XX@XXXXXX';
'XXX@XXXXX';
'XXXX@XXXX';
'XXXXX@XXX';
'XXXXXX@XX';
'XXXXXXX@X';
'XXXXXXXX@'];

Matlab, 120 111 bytes

function f=c(f);c=@(x,i)conv2(x+0,ones(i),'s');a=c(f<34,3);for k=f;a=c(a&f<65,3)|a;a=c(a&f>99,5)|a;end;f(a)='-'

Convolution is the key to success.

The idea is following: Find the active bomb. Enlarge this area to a 3x3 square. Find new affected bombs, enlarge the correspoding areas to the corresponding size and add those to the previously destroyed area. Repeat this enough times (in my case as many times as we have input characters, just because that is the shortest variant) to be sure that we reached a stationary point (=no more exploding bombs). Then set all the destroyed area to - and display the result.

The input is assumed to be a matrix of characters, e.g.

['!XXXXXXXX';
'X@XXXXXXX';
'XX@XXXXXX';
'XXX@XXXXX';
'XXXX@XXXX';
'XXXXX@XXX';
'XXXXXX@XX';
'XXXXXXX@X';
'XXXXXXXX@'];
1
source | link

Matlab, 120 bytes

f=input('');c=@(x,i)conv2(x+0,ones(i),'s');a=c(f<34,3);n=a;for k=f;a=c(a&f==64,3)|a;a=c(a&f>99,5)|a;end;f(a)='-';disp(f)

Convolution is the key to success.

The input is assumed to be a matrix of characters, e.g.

['!XXXXXXXX';
'X@XXXXXXX';
'XX@XXXXXX';
'XXX@XXXXX';
'XXXX@XXXX';
'XXXXX@XXX';
'XXXXXX@XX';
'XXXXXXX@X';
'XXXXXXXX@'];