Skip to content

Conversation

@psc478
Copy link
Owner

@psc478 psc478 commented Oct 26, 2017

Checkpoint Rubric

This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.

Checkpoint 1

  • All tests passed: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript: 30 points

Checkpoint 2

  • The application works as it should: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript and the DOM API: 30 points

Checkpoint 3

  • Use of React: 25 points
  • Accesses an API: 25 points
  • Proper use of documentation (commenting on code): 25 points
  • The application functions as it should: 25 points

function checkForWin() {
// Your code here

if (stacks.c[3] === 1){ //checks for the "1" block on top of a four-stack in stack "c."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like that you reset the board.
Checking to see if the last piece is 1 assumes that the reset of your code will not let that happen.
While this is logically correct, a better approach might have been to verify that the a and b stacks are empty and the c stack - 4,3,2,1

//console.log("Length of startStack: " + begin.length);
//console.log("Value of block being moved: " + begin[begin.length - 1]);
//console.log("Value of block being topped off: " + final[final.length - 1]);
if (begin[begin.length - 1] > final[final.length - 1]) { //making sure the "block" is being move onto a larger "block"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should return a false if it is not a legal move.
Also checking for a legal move is a better approach. IE start out assuming the move is not legal unless you prove otherwise.

This implementation allows you to move piece back to its own stack. Not wrong just weird that it would be allowed.

// Your code here

/*
*This function removes a block from a stack and adds that block to a different stack
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the documentation, and it was obvious you used log statements to debug as you were going along. Nice!

//console.log("Length of startStack: " + begin.length);
//console.log("Value of block being moved: " + begin[begin.length - 1]);
//console.log("Value of block being topped off: " + final[final.length - 1]);
if (begin[begin.length - 1] > final[final.length - 1]) { //making sure the "block" is being move onto a larger "block"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also allow me to move from an empty stack to another empty stack, or from an empty stack to a non-empty stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants