Skip to content

kwokster10/About_Me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Welcome...View at your own risk!

I'm Julie Kwok.

Contact me at [email protected]

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.

Siberian Husky on Frozen Lake

Still don't agree? Click to this video!

French Bulldog Puppy

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?

function clearBoard() {
    for (var i=0; i<checkerboard.length; i += 1) {
        var h=0;
        while (h<checkerboard.length) {
            checkerboard[i][h] = null;
            h+=1;
        }
    }
}

function setUpRed() {
    for (var i=0; i<3; i += 1) {
        var h=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';
        }
    }
}


function setUpBlack() {
    for (var i=5; i<checkerboard.length; i += 1) {
        var h=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';
        }
    }
}

var pieces = {
    "red" : [],
    "black" : []
};

function piecesRed() {
    for (var i=0; i<checkerboard.length; i+=1) {
        for (var h=0; h<checkerboard.length; h+=1) {
            if (checkerboard[i][h] ==='R') {
                    pieces["red"].push([i,h]);
            }
        }
    }
}

function piecesBlack() {
    for (var i=0; i<checkerboard.length; i+=1) {
        for (var h=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:

Lemon Github

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages