6 kyu

JoJo's Bizarre Kata

388 of 851GiacomoSorbi
Description
Loading description...
Fundamentals
Regular Expressions
Strings
  • Please sign in or sign up to leave a comment.
  • daniel.ro Avatar
  • QKiryu Avatar

    slight issue but maybe add some edge cases as a regex that could passes for Jon Dajohnson could pass all python test cases

  • 4500zenja1 Avatar

    Ruby fork which resolves the issue below me (link) + simplifies the test coding.
    P.S. Oh and also if this fork will be approved, I think I'd like to try implementing fixes for the other issue (this one, under spoiler tag), if nobody is against it :)

  • 4500zenja1 Avatar

    Ruby testing is broken: even if you solve the kata without regex, it requires from you to put smth inside of it, or else it drops the error No examples found. For other languges this problem does not exist though.

  • 23b00t Avatar

    I've only done the regex yet and it gives me an error by testing and attemt:

    Time: 1021ms Exit Code: 1
    Test Results:
    Log
    No examples found.
    
  • Jam14man Avatar

    Instructions: " ...either create a regex expression or a function to find... " But sample tests have a check of regex only.

  • akar-0 Avatar

    JS: sample tests are broken

    ReferenceError: assert is not defined
        at Context.<anonymous> (test.js:20:9)
        at processImmediate (internal/timers.js:464:21)
    
  • Blind4Basics Avatar

    the image link is broken (description)

  • vdtdg Avatar

    NameError: name 'randint' is not defined

    When running the random test cases...

    The random.randint import seems missing from the testing file.

  • elmofre Avatar

    what i can do about it "name 'Test' is not defined. Did you mean: 'test'?"... just in google collab all ok...

  • danielcues Avatar

    This comment has been hidden.

  • ejini战神 Avatar
    • Node 12 should be enabled (Refer this and this for more info)

    • python 3.8 should be enabled and Python new test framework should be used (Refer this & this for more detail)

  • user9644768 Avatar

    Ruby 3.0 should be enabled. Description formatting is broken.

  • akar-0 Avatar

    This comment has been hidden.

  • FArekkusu Avatar

    strings may be of 1 word, 2 words, 3 words or more

    And how should names consisting of 1 word be handled? There's no "first name and surname".

  • FArekkusu Avatar
    Traceback (most recent call last):
      File "main.py", line 3, in <module>
        built_in_test_function("Jonathan Joestar", True)
      File "/home/codewarrior/setup.py", line 8, in built_in_test_function
        sol1=re.search(regex,name)!=None
    NameError: name 'regex' is not defined
    
  • G_kuldeep Avatar

    Traceback (most recent call last):

    File "main.py", line 3, in <module>

    built_in_test_function("Jonathan Joestar", True)

    File "/home/codewarrior/setup.py", line 8, in built_in_test_function

    sol1=re.search(regex,name)!=None

    NameError: name 'regex' is not defined

    I am neither deleting anthing nor doing anything

  • paul2 Avatar

    need better tests.

  • marbiru Avatar

    Very small thing but I'm not entirely sure from description whether a three-word name can be valid, e.g. Joseph Joestar III or Joanne Evelyn Josephin or whatever. I passed the test but it didn't come up. This part in the description you still may consider the first word as the firstname and the last word as the surname makes me suspect that 'Joanne Evelyn Josephin' would pass but 'Joseph Joestar III' would fail, but to me the description isn't really clear (especially since one example of a failing name is "George Joestar II", which makes it seem like the reason for failure is the Go and not the II, if Jorge Joestar II would also fail). It looks like maybe you discussed this two years ago with @sayfidz, below, but I'm not sure what the conclusion was.

    Thanks for the kata! The two-solutions-option is such a lovely thing, really appreciate you doing that.

  • Blind4Basics Avatar

    almost an issue but well... Let's rather say a suggestion: ;)

    Your specs strongly ask for the two following tests:

    • "jo... ... ...gio" (case sensitive or not) => False
    • "gio... ... ...gio" (case sensitive or not) => False

    Currently, it's not tested.

  • jamad Avatar

    This comment has been hidden.

  • NIaa Avatar

    300 jojo fans, great DAZE.

  • Voile Avatar

    This comment has been hidden.

  • Rohan.ag Avatar

    hey there, i am very new to this regex style of programming, so i need some help out here. What i don't understand is how can i give input to the parameter when i am not calling a function? ex: regex=re.search('blah*',name) from where do i get this name parameter..

    P.S. i am sorry if my question is a bit messy

  • dgoldbarg Avatar

    Soft.

  • PaulCalvelage Avatar

    This comment has been hidden.

  • PG1 Avatar

    Really enjoyed this kata. My solution may not be eloquent... but I'll refactor another day!

  • Azuaron Avatar

    This comment has been hidden.

  • nooblad Avatar

    Hi, Can a single word be valid ? Cause the js version test let pass Johjo, Johjoh and Giohgioh for examples. Your test doesn't cover thoose cases, so i was wondering if it was a miscomprehension that it needs to have at least two words to be a valid Jojo's name. Sorry for my english, still nice kata.

  • fdavis Avatar

    All of my random tests in Ruby were Jonathon Joestar, is this expected?

  • DeanBrown Avatar

    enjoyed this one. and sorry if i got a bit wordy on comments in my solution but hey you asked :)

  • DivyanshBatham Avatar

    You have done a lot of Crafty work in the Test Cases, I was pretty amazed while solving the kata...:)

  • jolaf Avatar

    It sucks that I HAVE to keep BOTH regex AND is_jojo in my solution while I actually implement only one of them. :(

  • Chunibyoic Avatar

    This comment has been hidden.

  • Chunibyoic Avatar

    The last test got me

  • GaurangTandon Avatar

    This comment has been hidden.

  • ChristianECooper Avatar

    I deleted the regex variable in the Python version as I solved the problem without Regex, but the tests seem to rely on it being there!

  • sayfidz Avatar

    Cool kata, thank you! A couple of potential edge cases: I believe that the solution would currently pass "Joseph Joplin Clapton" as a valid "JoJo", although I believe "Clapton" should be interpreted as the surname, which is not a valid "Jo", and therefore should not pass. Also, it looks like there is a fairly small chance that the random test cases will produce a situation where the first name starts with "Gio" and the last name starts with "Jo", or vice versa. A solution can pass the test cases (mine did) if it allows one name to start with "Jo" and the other with "Gio". It might be worth throwing in a couple more "Gio"s in the random test cases or a defined test case where one is a "Gio" and the other a "Jo". Thanks again for the creative kata. I like the option to solve it two different ways, and how the solution checks to see if you did. Very cool.

  • GiacomoSorbi Avatar

    Tsugi ni omae wa "I want to translate it" to yo [=You are going to say: "I will translate it"]: if you do, please, try to keep the original format of this kata, allowing for both a correct regex or a correct function to solve it (with some extra message if you do both).

    I know it is annoying, but I wanted a stimulating kata that both beginners and complete novices to regexes could go and solve to learn a bit about them, so the double road seemed to me like the best option. Hopefully, this kata will get a good number of good solutions, possibly commented, so to let others learn :)

    [And sorry for the omae above; I know it is rude to use it, but it was just a quote from Joseph]