set.seed(4);x=1:121;y=x[!(x%%11 %in% 0:1|(x-1)%/%11 %in% c(0,10))];z=sample(y,10);x=x*0;for(t in z){p=t+c(-10:-12,-1,1,10:12);x[p]=x[p]+1};x[z]=9;mmatrix(x[y],9);m[m==9]='*';m
Standard input is empty
Standard output is empty
Error: could not find function "mmatrix" Execution halted
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!