> s <- c(rep(1,32), rep(2, 32))
> m <- matrix(sample(s,64), 8, 8)
> m
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 2 1 2 1 2 1 1 1
[2,] 2 1 2 1 1 1 2 1
[3,] 2 2 1 2 1 1 2 2
[4,] 2 2 1 1 2 2 1 2
[5,] 2 1 1 2 2 1 1 2
[6,] 1 2 2 2 1 2 1 1
[7,] 2 2 1 2 2 1 2 1
[8,] 2 1 1 1 1 2 2 1