Generate a Nine-Ball Pool rack
R, 61 bytes



cat(paste0(c("  1
 ","","
","9 ","
 ","","
  "),sample(2:8)))


Try it online!

Prints alternately the proper whitespace/newline (with 1 and 9 included) and elements of a random permutation of \$\{2,\ldots,8\}\$.