Skip to content

Instantly share code, notes, and snippets.

@omas
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save omas/f4823953c473d4f029b1 to your computer and use it in GitHub Desktop.

Select an option

Save omas/f4823953c473d4f029b1 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<script>
var map = {
col:20
,row:20
}
var column = ((function(max,value){
var tmp = [];
for (var col = 0; col < max; col++)
tmp.push(value);
return "[" + tmp.join(",") + "]";
})(map.col,-1));
document.write("([" + "<br>");
for (var row = 0; row < map.row; row++){
if (row == 0) document.write("&nbsp;");
else document.write(",");
document.write(column + "<br>");
}
document.write("]);");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment