Skip to content

Commit a47ae0a

Browse files
committed
separated makeGrid from main
1 parent fac3ada commit a47ae0a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

js/secrets.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ for (var f in flowers) {
4141
})
4242
}
4343

44+
function makeGrid(rows, cols) {
45+
$('body').empty();
46+
for (var r = 0; r < rows; r++) {
47+
var rowId = "row" + r;
48+
var row = $("<div/>").addClass("row").attr("id", rowId).appendTo('body');
49+
for (var c = 0; c < cols + 1; c++) {
50+
var cellId = "cell" + ((r * rows) + c);
51+
$(row).append('<div class="cell" id="' + cellId + '"></div>');
52+
}
53+
}
54+
}
4455

4556
function roseMath(radius, v, k, t) {
4657
v.x = radius * Math.cos(k * t) * Math.cos(t);

0 commit comments

Comments
 (0)