var 보드 = new Array();
$(document).ready() {
newgame();
}
function newgame() {
init();
generateOneNumber() ;
generateOneNumber();
}
function init() {
Alert("sdf");
for (var i = 0; i < 4; i++) {
borad[ i] = new Array();
for (var j = 0; j < 4; j++) {
board[i][j] = 0;
var GridCell = $("#grid -cell-" + i + "-" + j);
gridCell.css("top", getPostTop(i, j));
gridCell.css("left", getPostLeft(i, j));
}
}
updateboardview ();
}
incture updateboardview () {
for (var i = 0; i & lt; 4; 4; 4; i ++) {
for (var. j = 0; j < 4; j++) {numberCell.css("너비", 0 px);
numberCell.css("높이", 0 px);
numberCell.css("top", getPostTop(i, j) + 100);
numberCell.css("왼쪽", getPostLeft(i, j) + 100);
} else {
numberCell.css("너비", 100px);
numberCell.css ("높이", 100픽셀);
numberCell.css("top", getPostTop(i, j));
numberCell.css("left", getPostLeft(i, j));
numberCell.css ("배경색", getNumberBackgroundColor(board[i][j]));
numberCell.css("color", getNumbercolor(board[i][j]));
}
}
}function generateOneNumber() {
var randx =parseInt(Math.floor(Math.random() * 4) );
var randy =parseInt(Math.floor(Math.random() * 4));
when(true) {
if (board[randx][randy] == 0) {
break;
}
var randx =parseInt(Math.floor(Math.random() * 4));
var randy =parseInt(Math.floor(Math.random() * 4));
}