I am in the process of creating a small game using the R console, and I am trying to add consecutive numbering to my empty playing field (which should be adaptive to changes in n_row and n_col). The final output should something look like this:
Here is my current code:
n_row <- 4
n_col <- 4
# Plot empty playing field
par(xaxs = "i", yaxs = "i")
plot.new()
plot.window(xlim = c(0.5, 4.5), ylim = c(0.5, 4.5))
grid(nx = n_col, ny = n_row, col = "grey")
box(lwd = 2)


