35
3
Take a matrix of positive integers as input, and make it explode!
The way you explode a matrix is by simply adding zeros around every element, including the outside borders.
Input/output formats are optional as always!
Test cases:
1
-----
0 0 0
0 1 0
0 0 0
--------------
1 4
5 2
-----
0 0 0 0 0
0 1 0 4 0
0 0 0 0 0
0 5 0 2 0
0 0 0 0 0
--------------
1 4 7
-----
0 0 0 0 0 0 0
0 1 0 4 0 7 0
0 0 0 0 0 0 0
--------------
6
4
2
-----
0 0 0
0 6 0
0 0 0
0 4 0
0 0 0
0 2 0
0 0 0
6Unknown; man; one thousand. – MooseBoys – 2017-06-25T17:52:28.303
2Now I'm confused – Grajdeanu Alex. – 2017-06-26T14:49:24.677
@MrGrj The command literally makes something blow up – None – 2017-06-27T04:03:19.850
1+1 for the second gif "In the spirit of the challenge"! :) – Kevin Cruijssen – 2017-06-28T12:50:24.430