Skip to content

Instantly share code, notes, and snippets.

@winniecluk
Last active September 2, 2016 19:41
Show Gist options
  • Save winniecluk/8e69acd695fec407b6679c65e039b353 to your computer and use it in GitHub Desktop.
Save winniecluk/8e69acd695fec407b6679c65e039b353 to your computer and use it in GitHub Desktop.
Project 1 Code Review

Here is the code that creates new spiders. Is there another way I could have done this?

function replaceSpiders(){
  regenerateID = setInterval(function(){
    $('.spider-column').each(function(ind, column){
      $(this).html('');
      var result = getRandom();
      var resultID = getRandom3();
      if (result == 1){
        $(this).append('<img class="true spider p' + resultID + '" src="images/animated-widow.gif">');
      } else {
        $(this).append('<img class="false spider p' + resultID + '" src="images/animated-jumping.gif">');
      }
    });
  }, 4000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment