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.

[beta] Generate Random Whole Numbers within a Range - failing tests

See original GitHub issue

Challenge generate-random-whole-numbers-within-a-range has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

Another challenge which fails tests if coming from previous challenge but passes if I exit the challenge and come back in directly from the Map.

Notice in the screenshot the two variables it says are not defined, even though they do not exist in my code.

image



// Example
function ourRandomRange(ourMin, ourMax) {

  return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourRandomRange(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

  return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin;// Change this line

}

// Change these values to test your function
var myRandom = randomRange(5, 15);

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
RandellDawsoncommented, Feb 9, 2017

You experienced exactly what we did. I do not know how the site runs the challengeSeed / tail / tests. Would love to know for future reference.

0reactions
systimoticcommented, Sep 5, 2017

I can’t reproduce this issue on the latest beta, neither when coming from the previous challenge or after reload, so I’m closing this. If anybody does run into this issue again or can still reproduce this, please comment to let us know and we’ll reopen.

Happy coding!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generating random numbers - Program Evaluation
Beta distributions are neat because they naturally only range between 0 and 1—they're perfect for things like percentages or proportions or or ...
Read more >
Generate Random Whole Numbers within a Range - Guide
Generate Random Whole Numbers within a Range Hints Hint 1 randomRange should use both myMax and myMin, and return a random number in...
Read more >
Generate Random Whole Numbers within a Range - GitHub
Create a function called randomRange that takes a range myMin and myMax and returns a random number that's greater than or equal to...
Read more >
How to test random numbers? - Stack Overflow
With most tests you can supply a large file of random numbers (integer or floating point) and run various tests on that sample...
Read more >
Generate random numbers following a distribution within an ...
(I am working in R.) I know the function rnorm(n,mean,sd) will generate random numbers following normal distribution,but how to set the interval ...
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