var temp = ['cell', 'cell', 'cell', 'cell'];
var i = Math.floor(Math.random() * 4); //随机产生黑块的位置 Math.random()函数参数 0~1的随机数
temp[i] = 'cell black';
Math.random() 是得到一个[0-1)之间随机数。
Math.floor(i) 是得到一个数的整数部分,向下取整
Math.random()*4的值是[0-4)之间的随机数
tmp就是指随机出来的一个整数0,1,2,3其中的一个