5 kyu

Hello W... wait what?

Description
Loading description...
Puzzles
Algorithms
  • Please sign in or sign up to leave a comment.
  • locolemat Avatar

    I bloody love this Kata!

  • trashy_incel Avatar

    suggested tag: restricted

  • Alex-Kostenko Avatar

    This comment has been hidden.

  • G_kuldeep Avatar

    Very funny kata.. thanks:)

  • GCa Avatar

    Thank you for making this Kata. I really enjoyed it.

  • Wolvereness Avatar

    This comment has been hidden.

  • Voile Avatar

    I fixed the kata because the site change that has just been made at https://github.com/Codewars/codewars.com/issues/1010 allows such fixes now.

  • Blackbaud-BrandonJones Avatar

    This comment has been hidden.

  • cass3000 Avatar

    Hi (just to keep the issue alive and to have a fix),

    I'm facing the same problem, no matter what I write I always get:

    Error: Strings are not allowed.
    Found 'global was reassigned'
       at dontTryAndCheat
            at Object.handleError
            at ContextifyScript.Script.runInThisContext
        at Object.exports.runInThisContext
    

    @MentalAtom is this an issue or we are doing something wrong?

    Tnx.

  • igor_rajnjak Avatar

    Whatever I write the "strings are not allowed" issues comes up. Even when I reset the kata and submit it I get this... Also I don't quite understand why I can't use this or the global object? Tnx!

  • myjinxin2015 Avatar

    review the solution list and saw my solution again. I would to say: nice!!! ^_^

  • trehleb Avatar

    Every time I submit my solution or even when I submit default/empty solution the test throws the error:

    Error: Strings are not allowed.
    Found 'global was reassigned'
       at dontTryAndCheat
            at Object.handleError
            at ContextifyScript.Script.runInThisContext
        at Object.exports.runInThisContext
    

    Even the following code throws the error:

    var helloWorld = function() {
    
    }
    

    Maybe the issue is that Babel transpiles the code with the string "use strict" that is being identified as "prohibited" string by the kata?

    Could you please check if this is the case?

  • n33kos Avatar

    This comment has been hidden.

  • buttonupbub Avatar

    Thanks for this creative kata. Great to see the diversity of solutions.

  • AcesOfGlory Avatar

    I fucking love this Kata; one of my favourite on this website. It turns a very simple premise into a very challenging and thought-provoking task. It's great to see to many crazy and unique solutions people can come up with and really tests your thought process. Thanks!

  • user5036852 Avatar

    A really good funny kata! Thanks!

  • romerojp Avatar

    This comment has been hidden.

  • orangemukmuk8779 Avatar

    This comment has been hidden.

  • orangemukmuk8779 Avatar

    This comment has been hidden.

  • StanislavRadkov Avatar

    I wrote code to print hello world with the given restrictions.

    However if I leave the original function I get the following error:

    Error: Functions named Hello, World, or a combination of the above are not allowed. Found function helloWorld() at dontTryAndCheat

    If I rename it i get:

    ReferenceError: helloWorld is not defined

    Please advise how can i get to the actual tests!

  • Joe_fe Avatar

    This kata can't work now! I copy the solutions but also throw Error: Error: Functions named Hello, World, or a combination of the above are not allowed. Found function helloWorld() at dontTryAndCheat

  • bam Avatar

    This comment has been hidden.

  • bam Avatar

    Firstly, right after a few minutes and got the first error: Error: Functions named Hello, World, or a combination of the above are not allowed. Found function helloWorld() at dontTryAndCheat

    I want to point your attention that var a = function(){} isn't function a(){} !!! Assertion isn't a named function in JavaScript! (Yes, i already know how to solve this step, but you should edit the Description)

  • paceaux Avatar

    Now that I've completed the Kata, I have a few remarks

    1. Make it clear what's been disabled: the Number and String constructors, as well as their literals. Not only that, template strings are disabled, too. So '', "", `` are all disallowed.
    2. The regex that you're using isn't very nice. If you're using a regex at all, and not some sort of demon spawned from the 14th level of obfuscation hell who likes to bitch slap characters for no reason. What I mean, quite specifically, is that it can't discern what I've put in comments, and what I've not put in comments. Also, when I write /I"m not feeling this Kata/, it throws an error because I've decided to use an apostrophe... in a comment!
    3. I couldn't even assign a variable such as __1 . __1 = blah is not a thing I could do. Please make it clear that numbers and strings are disabled in both the left hand, and right hand side of operators.
    4. The whole things starts off with var helloWorld = function () {}, which immediately throws an error. Please either change how this starts off, or provide an explanation for why you want to watch the world burn. I'm fine with either

    Great kata, though. I hope to never do it again.

  • GiacomoSorbi Avatar

    This comment has been hidden.

  • user7703059 Avatar

    I don't know what I'm doing wrong here, but...

    If I submit this:

    var helloWorld = function () {
      return;
    }
    

    I get: Error: Functions named Hello, World, or a combination of the above are not allowed. Found function helloWorld() at dontTryAndCheat.

    If I rename the function to something else, I get this: ReferenceError: helloWorld is not defined.

    Also, my tests cases seem to be failing just because the function is named helloWorld and the assertion string is Hello World.

    Is all this correct and I should still be able to solve the problem like this?

  • abar Avatar

    This comment has been hidden.

  • krzkaczor Avatar

    It's really nice kata but c'mon - whole description is inconsistent (not even mention that tests are failing and boiler code is wrong). You are saying that there should be no literal hello world but putting it into comment also doesn't work. Probably it uses regex magic internally but it would be better to use some JS parser like Esprima or whatever and parse user source code.

  • daleyjem Avatar

    I don't see how people have the default var helloWorld = function(){...} It was failing for me just because of that.

    I feel like if you should change the boilerplate if it's going to prevent a "pass"

  • alex.budiakov Avatar

    Please check your test, even If I compare true = true it fails

    Found function helloWorld() 
       at dontTryAndCheat```
    
    
    
    
  • Insti Avatar

    I think the description needs to make clear that it is instances of literal 'strings',digits, or regular expressions in the source code which are disallowed.

    Use of String and Number types during execution is allowed.

    Also the function naming checks need to be stricter.

  • jimmy-ringo Avatar

    Expected: Hello World!, instead got: Helo World!

    Couldn't pass the test. What does it mean?

  • DCKT Avatar

    Any hint ? I'm stuck, I always got Error: Strings are not allowed. even if I return a number

  • candrabeqx Avatar

    how do you prevent some functionality in solution?

  • user5546530 Avatar

    Not quite sure how your supposed to solve this when the test case once submitted looks for a function called helloWorld. I solved it but since you updated the test cases it doesn't seem as though you can submit it?

  • aidanb Avatar

    That was a fun challenge. Kept catching myself using a stray 0 or ''.

  • YiyangLi Avatar

    I passed the test (finally), but got unknown error when I submit.

  • ThePanuto Avatar

    If my function isn't named "helloWorld", I get a reference error. If it is, I can't post the solution, because the function is called, well, "helloWorld".

    ...

    Is this also a part of the puzzle? LOL

  • Azuaron Avatar

    I find it laughable that any of these solutions have been voted "Best Practice". There are no best practices here!

  • Buck Avatar

    This comment has been hidden.

  • pmarrapese Avatar

    This comment has been hidden.

  • MMMAAANNN Avatar

    Nice kata. Green light!

  • osofem Avatar

    Wow! Really interesting kata!

  • Unihedron Avatar

    Since the Kata disabled Strings, Numbers and Regex, why add those tags?

  • ankr Avatar

    It's still possible to use a named function as template. (See my latest solution.)

  • ZozoFouchtra Avatar
    Error: Functions named Hello, World, or a combination of the above are not allowed. 
    Found function helloWorld() at dontTryAndCheat
    

    Muhahaha !

  • MentalAtom Avatar

    I just noticed that due to a change I made disallowing function names I disallowed every previous solution...

    They'll probably still work mostly, just change function helloWorld() to var helloWorld = function()

    Sorry!

    I think I'm done making it harder now :)

  • OverZealous Avatar

    This comment has been hidden.

  • MentalAtom Avatar

    Do you think also disallowing the "String" constructor would be a good idea? It allows for some answers which are very simple so it's a bit more challenging without.

  • bkaes Avatar

    Test.expect just tests whether the value isn't falsy, so even return true; solves the kata.

    Instead, you want to use Test.assertEquals.

  • MentalAtom Avatar

    This comment has been hidden.