Weren't we supposed to use arguments as an option

Tell us what’s happening:
Describe your issue in detail here.
Hi all,
This project took me easily a full day to complete 2 of the 7 owing to the fact that I thought that it was an argument question because a) the “hint” speaks of +number -number (in other words numbers manipulation, b) there are arguments involved with this function. As SOON as I saw the arguments I knew that the question involved needed calculations. Below (in comments on the “eagle” if one uses -6 (4-6=-2…"eagle is a -2 stroke). This works if all rest below questions have been taken out (meaning the debugging takes “eagle” away so theres no problems with it anymore…so to ME…this calculation …works, I DIDN’T do the other questions in calculation format because it was just taking way too long) my question though is the following…wasn’t arguments supposed to be one option that could be used to solve this problem???
If one looks at the answers they answer really is using “==” in most cases, that I can understand and see. It seems to me that if there is an argument which is part of teh problem doesn’t necessarily MEAN that it’s compulsory to use it (if there are other…more simple way to solve the problems with same results…why NOT?).
Otherwise…please explain why then does the hint actually ask for +number, -number (to me it spells out arguments and calculations??)

Thank you in advance!!!

  **Your code so far**

var names = ["Hole-in-one!", "Eagle", "Birdie", "Par", "Bogey", "Double Bogey", "Go Home!"];
function golfScore(par, strokes) {
// Only change code below this line
if (strokes == 1) {
  return "Hole-in-one!";
} /*else if (strokes-6) {
strokes<=par-2;
return "Eagle";
}*/
  else if (strokes <= par - 2) {
  return "Eagle";
}
else if (strokes==par-1){
  return "Birdie";
}
  else if (strokes == par) {
  return "Par";
} else if (strokes == par + 1) {
  return "Bogey";
} else if (strokes == par + 2) {
  return "Double Bogey";
} else {
  return "Go Home!";
}

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

golfScore(5, 4);


/*if (strokes == 1) {
  return "Hole-in-one!";
} else if (strokes-6) {
strokes<=par;
return "Eagle";
}*/
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 6.1; rv:89.0) Gecko/20100101 Firefox/89.0

Challenge: Golf Code

Link to the challenge:

I think it may mean to use variable + number like you did here

but it’s really difficult to understand, you are right

In the end I figured the “==” pretty much forces (as another way to get an answer) left to be same as right. This method took me 10 mins and I was done

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.