You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My digits: well you should have the guts to ask me for them.
I love furry animals but dogs trump them all. My new background from exploring Bored Panda.
Still don't agree? Click to this video!
As you can see this is dangerous and can go on all day so let's move on to other things.
//So this is from the last exercise of the fundamentals. //I think I did it right but have a feeling that using .map function would have made my code cleaner. //Any thoughts?functionclearBoard(){for(vari=0;i<checkerboard.length;i+=1){varh=0;while(h<checkerboard.length){checkerboard[i][h]=null;h+=1;}}}functionsetUpRed(){for(vari=0;i<3;i+=1){varh=0;if(i%2===0){for(h=0;h<checkerboard.length;h+=2)checkerboard[i][h]='R';}else{for(h=1;h<checkerboard.length;h+=2)checkerboard[i][h]='R';}}}functionsetUpBlack(){for(vari=5;i<checkerboard.length;i+=1){varh=0;if(i%2===0){for(h=0;h<checkerboard.length;h+=2)checkerboard[i][h]='B';}else{for(h=1;h<checkerboard.length;h+=2)checkerboard[i][h]='B';}}}varpieces={"red" : [],"black" : []};functionpiecesRed(){for(vari=0;i<checkerboard.length;i+=1){for(varh=0;h<checkerboard.length;h+=1){if(checkerboard[i][h]==='R'){pieces["red"].push([i,h]);}}}}functionpiecesBlack(){for(vari=0;i<checkerboard.length;i+=1){for(varh=0;h<checkerboard.length;h+=1){if(checkerboard[i][h]==='B'){pieces["black"].push([i,h]);}}}}
Well I'm sure you've had enough of me. Head back to the master lemon repo here: