What surrounds my Minesweeper tile?
APL (Dyalog Unicode), 28 15 bytes



-13 bytes thanks to ngn!

{3 3⍴5⌽⍵,⍵≥8?8}


Explanation:

{...} A direct function (D-Fn), ⍵ is its right argument.

8?8 deal 8 random numbers from the list 1..8:

      8?8                         
7 2 1 8 4 6 5 3


⍵≥ is the argument greater or equal to each of them?:

      5 ≥ 7 2 1 8 4 6 5 3   
0 1 1 0 1 0 1 1


⍵, prepend the argument to the boolean list:

      5 , 0 1 1 0 1 0 1 1
5 0 1 1 0 1 0 1 1


5⌽ rotate the list 5 positions to the left, so that the argument is in the center:

      5 ⌽ 5 0 1 1 0 1 0 1 1
1 0 1 1 5 0 1 1 0


3 3⍴ reshape the list to a 3x3 matrix:

      3 3 ⍴ 1 0 1 1 5 0 1 1 0
1 0 1
1 5 0
1 1 0


Try it online!

J, 15 bytes

Also many bytes thanks to ngn!

3 3$5|.],]&gt;8?8:


Try it online!