question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Correct answer prints but is not being recognized

See original GitHub issue

Golf Code under JavaScript course

The test requests:

Strokes          Return
1                    "Hole-in-one!"
<= par - 2      "Eagle"
par - 1         "Birdie"
par                 "Par"
par + 1         "Bogey"
par + 2          "Double Bogey"
>= par + 3  "Go Home!"

My code: javascript

function golfScore(par, strokes) {
  // Only change code below this line

  if (strokes == 1)
    {
      return "Hole-in-one!";
    }

  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 if (strokes >= (par + 3))
  {
    return "Go Home";
  }

  else
  {
  return "Change Me";

  }  
  // Only change code above this line
}

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

It says the following is not done:

golfScore(4, 7) should return "Go Home!"
golfScore(5, 9) should return "Go Home!"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
erictleungcommented, Oct 21, 2016

@chocolatechimpcookie thanks for the issue but if you get stuck or have questions with a challenge in the future, please first ask questions to the Help Room. Hint: look at the two tests you have pointed out and double check whether the strings it returns is exactly the same as what it requires. You have a missing character in the returned string. Happy coding!

0reactions
OlegEfcommented, Jan 8, 2017

Thank’s for help! You must change (=) (==). I fond solve in yor page and little change))

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Solve a Printer Not Recognized Error - Driver Support
If your printer is giving you a not connected or recognized error, we can help. Here is a fixed guide to solve your...
Read more >
Fix printer connection and printing problems in Windows
Check the cables (for wired printers). Make sure that the printer's USB cable is properly connected from the printer to your PC. If...
Read more >
What to Do When Your Printer Won't Print - PCMag
Try printing the document again, and be sure to choose File > Print from the menu rather than using a shortcut. Then, pay...
Read more >
13 Common Printer Problems and How to Fix Them
Turn on your printer using the power button, then turn on your computer again. Restart the print spooler service. Print your document.
Read more >
Printer NOT Working / Offline / Not Recognized - Fix - YouTube
How to Solve a Printer Not Recognized Error What to Check When a ... is ready but not printing printer problems and solutions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found