Freecodecamp: Code Golf is too hard or unclear

Created on 10 Jul 2017  路  7Comments  路  Source: freeCodeCamp/freeCodeCamp

According to Google Analytics, the Code Golf challenge is way too hard, and is taking campers an average of 6 minutes and 35 seconds to finish (if they finish - a lot of them seem to give up).

According to this table, campers spend more time on it than they do on the algorithm challenges.

pages_-_analytics

We need to either reword this or simplify the challenge so it can be completed in closer to 3 minutes. Otherwise, we should move it back to the algorithm section.

Most helpful comment

This challenge does have a large amount of constant strings which could cause users to take a longer time than a typical challenge. Maybe we could provide an array of the responses in the seed code. Make the seed code:

var names = ["Hole-in-one!", "Eagle", "Birdie", "Par", "Bogey", "Double Bogey", "Go Home!"];
function golfScore(par, strokes) {
  // Only change code below this line


  return "Change Me";
  // Only change code above this line
}

// Change these values to test
golfScore(5, 4);

This could help in two ways. The first is the users can save time by not having to type out each response. The second is this approach could minimize errors from typos in the response phrases (i.e. Hole-in-one! vs. Hole in one!).

We could remove the number of different responses. Maybe remove Eagle and Double Bogey.

All 7 comments

This challenge does have a large amount of constant strings which could cause users to take a longer time than a typical challenge. Maybe we could provide an array of the responses in the seed code. Make the seed code:

var names = ["Hole-in-one!", "Eagle", "Birdie", "Par", "Bogey", "Double Bogey", "Go Home!"];
function golfScore(par, strokes) {
  // Only change code below this line


  return "Change Me";
  // Only change code above this line
}

// Change these values to test
golfScore(5, 4);

This could help in two ways. The first is the users can save time by not having to type out each response. The second is this approach could minimize errors from typos in the response phrases (i.e. Hole-in-one! vs. Hole in one!).

We could remove the number of different responses. Maybe remove Eagle and Double Bogey.

@MiloATH yes - that is a great suggestion. I think leaving all the names is fine but we should pre-populate the array with the names. Since this was your suggestion, would you be interested in tackling this and submitting a PR?

Yes, I would like to tackle this and submit a PR.

The Golf Code challenge did take me longer that the other challenges. I did not initially realize that golfScore() had BOTH strokes and par as parameters. With the other IF ELSE challenges we were only dealing with one argument to pass into the IF ELSE condition. I found myself in that "flow" and completely overlooked that two parameters were available to work with in the IF ELSE condition. I also found myself looking at the Strokes/Par table thinking, "How will IF( <= par-2) work?" After a little head scratching, I realized the values under the Strokes column were what you were supposed to compare Strokes to (i.e. IF (strokes <= par-2)).

Hopefully, this feedback is helpful. I think the confusion is coming from the wording of the challenge and suddenly going from using one passed in parameter to two in your IF ELSE condition.

@sbennett2911 Awesome. @MiloATH has a PR open already. Could you take a look at that first and let me know what you think of his proposed changes?

I agree with MiloATH's proposed changes. Would definitely reduce the potential for typos when working the problem.

As a side note, feel free to let me know if I am breaking any GitHub etiquette at any point. Zero experience providing input on collaborative projects. Looking for to learning and have really enjoyed FreeCodeCamp thus far. You guys and gals are doing awesome work. :)

@sbennett2911 Sure - we will let you know in a polite way if you break GitHub etiquette. Thanks for being receptive to feedback :)

Was this page helpful?
0 / 5 - 0 ratings