Freecodecamp: Infinite Loops on Roman Numeral Converter

Created on 9 Aug 2016  路  13Comments  路  Source: freeCodeCamp/freeCodeCamp

So I've accidentally ran two infinite loops inside of 2 while loops that are functional so the system didn't realize and give me an error initially.

Now it loads the code immediately when I go to the the problem so it's impossible to fix from my end as far as I know.

Luckily I got a screenshot of the code I ran before I shot myself in the foot:

screen shot 2016-08-08 at 5 18 47 pm

FYI - IF YOU FIND YOURSELF LOCKED OUT, you can disable JavaScript (Safari: Develop>Disable JavaScript) on your browser. Once JavaScript is disabled, go into the roman numeral exercise. Your browser won't load the infinite loop code. From then you can click the 'reset' button to get rid of your old code. Once your code is reset, you can re-enable JavaScript and get back to work (this time _more cautious of infinite loops_).

For future students, we need to examine the way the console tests the code for infinite loops to ensure it doesn't allow people to create infinite loops inside of two perfectly rational loops.

At least, that how I see the problem. You guys are superstars who are helping to build this thing.

help wanted

Most helpful comment

Yeah, as I said this is a good solution and of course we can add it to wiki, but it's a high chance that people will discover it on a google search.

I just discussing the point of discovering it. Nevertheless it won't hurt anyone to add it to wiki. :sweat_smile:

Tagging as a help wanted and first timers.

Potential Contributors, please create an article on the forum at http://forum.freecodecamp.com, if you need guidance connect with us on the HelpContributors chat room.

/cc @Rafase282 (Just FYI)

All 13 comments

@iarobinson thanks for the issue. Unfortunately, infinite loops can pop up with certain challenges. Another way to disable the auto-run of your code is to add run=disabled in your URL.

URL: http://www.freecodecamp.com/challenges/Algorithm-meet-Algorithm#?solution=function%20meetBonfire(argument)

No-Run URL: http://www.freecodecamp.com/challenges/Algorithm-meet-Algorithm#?run=disabled&solution=function%20meetBonfire(argument)

Source: https://github.com/freecodecamp/freecodecamp/wiki/FreeCodeCamp-Disable-Code-Autorun

I haven't checked your method of disabling the challenge from auto-running but if so, we may want to add it to the Wiki.

@FreeCodeCamp/issue-moderators should we add this method to the Wiki?

@erictleung well the run=disabled flag is fairly simple check to add, and involves lesser no of steps. We have had this as a protection.

I think the other method is good, but people will discover that with a simple google search. I think we can skip that from the wiki.

@raisedadead just keep in mind that "disable JS in a browser" it's an extremely easy to remember solution, while run=disabled is something that you need to search for when it happens, even though you saw the solution in the past, but you don't remember exact line and the place in the url where to insert this line.

In other words, once a camper saw the solution "disable JS in a browser if messed up with infinite loop" somewhere in the chatroom or in wiki, there is a big chance that camper will remember this easy solution for at least many months.

Yeah, as I said this is a good solution and of course we can add it to wiki, but it's a high chance that people will discover it on a google search.

I just discussing the point of discovering it. Nevertheless it won't hurt anyone to add it to wiki. :sweat_smile:

Tagging as a help wanted and first timers.

Potential Contributors, please create an article on the forum at http://forum.freecodecamp.com, if you need guidance connect with us on the HelpContributors chat room.

/cc @Rafase282 (Just FYI)

First of all do you check that count is smaller than the value you compare?

@raisedadead As a first time contributor to the FCC project, I'd like to take this task. Just wondering, why did you instruct potential contributors to create an article on the forum before fixing?

@danyim, if you see the discussion on this thread, requires you to create a new article as per the solution in the opening post. And doing that itself is the fix.

Did you have anything different in your opinion?

I wasn't able to edit the original post, but listed the steps as outlined above in a reply:
http://forum.freecodecamp.com/t/disable-code-auto-run-on-free-code-camp/19511/3?u=danyim

Please close if that resolves the issue.

@danyim it would be great if we can add a short guidance how to disable JS at least in main browsers

  • Chrome
  • Firefox
  • Safari

Something like this:

(Safari: Develop>Disable JavaScript)

In case you didn't know, JSBin has an open-source (MIT license) loop protect library which may solve this issue of infinite loops.

@Mottie thanks, we already use loop protect a modified version of jsbin (albeit the jsbin version has not been updated since long).

Removing, first-timers tag for this being left since long. Opening up for any one willing to take up writing the article on the forum.

I will take this and create a new article if needed, but is the article mentioned above, http://forum.freecodecamp.com/t/disable-code-auto-run-on-free-code-camp/19511, all that is needed or should there be a new article created?

@wjhurley I don't think a new article is necessary. I'm closing this issue.

Was this page helpful?
0 / 5 - 0 ratings