7 kyu

Smart Toaster

Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • FArekkusu Avatar

    Code length is tested incorrectly.

  • user5036852 Avatar

    Very challenging kata. Thanx.

  • sfoulk Avatar

    This comment has been hidden.

  • bkaes Avatar

    If one uses 'letorconst` or other ES6 features, the code will get longer due to the transformation by babel. That should get mentioned in the description.

  • jdpunk1 Avatar

    Pls help I've done a character count elsewhere it shows 245, the test says 280? I also sneakily tried assigning strings to vars at one point, which brought the actual count down further, but in the test it went even higher! confused..

  • tomada Avatar

    is there a way to do this in fewer than 250 chars without using regex? My only exposure to JS is completing a Codecademy course and some level 8 and level 7 katas. Based on my limited experience, I instinctively reached for a 'switch' statement, but that puts me around 350 chars, even after smushing my code together as much as possible. I suspect that I'm missing a more elegant solution, but I don't know regular expressions.

  • mejiamanuel57 Avatar

    This comment has been hidden.

  • myjinxin2015 Avatar

    I post this issue because your random test is not really "random", all of them are invaild bread, could you put some "good bread" in your "random" test?

  • PetrHavelka Avatar

    My solution has 250 characters but in test i wont pass. It said that i have 324 characters:( BUG!

  • Unnamed Avatar

    It looks like constructors can be put in many toasters...

  • donaldsebleung Avatar

    Needs random test cases

  • GiacomoSorbi Avatar

    As I told you personally a little while ago, awesome kata Peter :)

    I would just add some less lenient tests to the ones already in, as some solution like the one from Pete would not pass in that case (I still like his solution and he made a smart bet in developing that, bravo!); strangely enough, I did NOT go for the regex approach and I still wonder if there is some way to improve significantly my solution already under 200 chars (I could take some tip from Pete, mh...), but had a blast solving this.

    Special kudos to Raul for thinking out of the box in a really simple, smart way :)