Skip to content

Conversation

@walzer85
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.

Eric, your logic is good and it seems like you're planning out where you want to go in your code. However, we just need to refine your follow through and methods. Make sure every step of the way you are testing your code. Don't assume that your function works, that's how you miss a lot of small bugs that make your app fail.

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

isLegal

Choose a reason for hiding this comment

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

This is calling a variable not a function.

// Your code here

isLegal
}

Choose a reason for hiding this comment

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

I see where you are going with this, however, in functional programing you want to have each function have a specific and containable purpose. So isLegal()'s only job is to check if the move is legal, then if the return of that function is legal, then you would call your move function.


//checkForWin, if all of the numbers are in the last stack, run the win sequence, which should reset the object, if statement
const checkForWin=()=>
if (stacks === [a: [], b: [1], c:[4, 3, 2, 1]]) {

Choose a reason for hiding this comment

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

I like where your'e going here, however in Javascript, you can't directly compare two objects or arrays. The reason being is that every object is different. So if you made an object const a ={} and const b = {}, Javascript will never evaluate a === b. So knowing that, what is a different way that you could check for a win?


//isLegal(), checks to see if the last index of the start stack is less than the end stack last index. If the value is less, run movePiece. If the value is greater, deny the move, lastindexof method
const isLegal=(startstack, endStack)=> {
if((startstack.lastindexof < endStack.lastindexof) || (startstack.lastindexof > 0)) {

Choose a reason for hiding this comment

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

lastIndexOf is being called incorrectly. It's a method, so you need to call it as a function and give it at least one argument. Please consult the docs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf

};
//movePiece(), Moves the last index of the startStack to the last index of the endStack, lastindexof method
const movePiece=(startstack, endStack)=> {
endStack.push(startstack.lastindexof)

Choose a reason for hiding this comment

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

lastIndexOf is being called incorrectly. It's a method, so you need to call it as a function and give it at least one argument. Please consult the docs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf

//movePiece(), Moves the last index of the startStack to the last index of the endStack, lastindexof method
const movePiece=(startstack, endStack)=> {
endStack.push(startstack.lastindexof)
startstack.lastindexof.slice

Choose a reason for hiding this comment

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

I see that you're trying to chain methods here, and what you're trying to do, however slice and lastindexOf are being called incorrectly.

function movePiece() {
// Your code here
//printBeginningStacks, reset the var stacks to its original position, nest stacks inside
const printBeginningStacks=(stacks)=> {}

Choose a reason for hiding this comment

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

Not sure what this function does.


function printStacks() {
//This function prints the stacks on to the screen. Part of premade code
let printStacks() {

Choose a reason for hiding this comment

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

this should be a const and this is not correct syntax

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