Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $(document).ready(function() {
  2. var derp = prompt("Choose the length of the sides, which is in the set 2^n!");
  3. buildBlocks(derp, delayAlert());
  4.  
  5.  
  6. });
  7.  
  8. function buildBlocks(derp, callback) {
  9. setTimeout(function() {
  10. var complete;
  11. for (var i = 0; i < derp; i++) {
  12. $("#main").append("<div class='row text-center' id='row" + i + "'>");
  13. for (var j = 0; j < derp; j++) {
  14. $("#row" + i).append("<div class='block'></div>");
  15. }
  16. $("#main").append("</div>");
  17. if (typeof callback == 'function')
  18. callback();
  19. }
  20. }, 10);
  21. };
  22.  
  23. function delayAlert() {
  24. setTimeout('alert("Click to on a block to create a hole in the grid!");', 100);
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement