Skip to content

Conversation

@LauraColten
Copy link
Owner

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

Copy link

@reneemeyer reneemeyer left a comment

Choose a reason for hiding this comment

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

Good job, just some function organization changes. Overall though, great methods


function movePiece(startStack, endStack) {
if (startStack === 'a' && endStack === 'b') {
let mover = stacks.a.pop();

Choose a reason for hiding this comment

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

should be const

// Your code here

function movePiece(startStack, endStack) {
if (startStack === 'a' && endStack === 'b') {

Choose a reason for hiding this comment

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

for every stack and letter, you're checking if the stack is a,b, or c, twice, that's a lot of repetition that you can condense.

let mover = stacks.a.pop();
stacks.b.push(mover);
} else if (startStack === 'a' && endStack === 'c') {
let mover = stacks.a.pop();

Choose a reason for hiding this comment

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

should be const

let mover = stacks.a.pop();
stacks.c.push(mover);
} else if (startStack === 'b' && endStack === 'a') {
let mover = stacks.b.pop();

Choose a reason for hiding this comment

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

should be const

let mover = stacks.b.pop();
stacks.a.push(mover);
} else if (startStack === 'b' && endStack === 'c') {
let mover = stacks.b.pop();

Choose a reason for hiding this comment

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

should be const

let mover = stacks.b.pop();
stacks.c.push(mover);
} else if (startStack === 'c' && endStack === 'a') {
let mover = stacks.c.pop();

Choose a reason for hiding this comment

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

should be const

let mover = stacks.c.pop();
stacks.a.push(mover);
} else {
let mover = stacks.c.pop();

Choose a reason for hiding this comment

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

should be const

function isLegal(start, end) {
const startStack = stacks[start];
const endStack = stacks[end];
if (startStack.length === 0) {

Choose a reason for hiding this comment

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

anytime that you see that you're returning true or false, return the evaluation


function checkForWin() {
// Your code here
if (stacks.b.length === 4 || stacks.c.length === 4) {

Choose a reason for hiding this comment

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

anytime that you see that you're returning true or false, return the evaluation

function towersOfHanoi(startStack, endStack) {
// Your code here

movePiece(startStack, endStack);

Choose a reason for hiding this comment

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

you should only move the piece if your function is legal, and you should only check for win if your function is legal

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