Retired

Chemical Name (retired)

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

    It seems there is a problem with the test with the python, when I try to print the variable name and return nothing, the test shows stuff like this to_chemical("")
    Log
    admiraal
    to_chemical("admiraal")
    Log
    codewars
    to_chemical("codewars")
    Log
    nam
    to_chemical("nam")
    Log
    namo
    to_chemical("namo")
    Log
    dsb
    to_chemical("dsb")
    Log
    hiphop
    to_chemical("hiphop")
    Log
    baga
    it seems the test is one step behinde the actual test (sorry if it's unclear)

  • GGor Avatar

    Are we supposed to write the Mendeleiev's table by hand? (please no)

  • Unnamed Avatar

    If this is not the case, check if the previous symbol + current letter will make valid symbol(s). (e.g. r + a => Ra or Na + m -> NAm)

    It's not clear what should be done when it is a valid symbol, but it's already used in the previous symbol and can't be rebound: baga: B -> Ba -> BAg -> ??? According to the instructions, the string is processed character by character and only one previous symbol is checked, so there's no way to get anything for baga from BAg.

    • Admiraal Avatar

      Thanks, the instructions were indeed incomplete. I decided to remove these instructions completely, so users have to find a correct algorithm on their own.

      Let me know if you think this is a bit to scant.

    • Unnamed Avatar

      Looks OK.

      Issue marked resolved by Unnamed 5 years ago
  • Blind4Basics Avatar

    you need to constrain a bit more your random generator: for now it almost never generates inputs leading to a valid solution (edit: well, "almost never" is a bit too strong... Let's say "rather rarely")

    • Admiraal Avatar

      I now have added the test valid_symbols which picks some permutation of the valid symbols, so those will always have a correct answer.

      Issue marked resolved by Admiraal 5 years ago
  • Blind4Basics Avatar

    I just realized my solution is based on an assumption, so this needs to be clarified in the description (and/or changed on the implementation side):

    for now all the chemical symbols are 1 or 2 chars long only (while some 3 char names exist, even if unstable...) => the description need a clear update about that in either case, second question is, do you limit them to 2 chars or do you add 3 chars symbols in the tests?

  • Blind4Basics Avatar

    Hi,

    Nice one, I'd say... ;)

    You need to change the checker, because your random generator may generate stuff like this:

     to_chemical('iuyneubo'): 'IUYNEuBO' should equal 'IUYNeUBO'
    

    => both are valid (or you need to give more precise constraints and put that test in the fixed tests)

    EDIT: you have to say the type of CHEM_SYMBOLS, too.

    • Unnamed Avatar

      Looks pretty clear to me. When you have "IUYNEu", "E" is already fixed and there's no to regroup it according to the instructions. The result should be "IUYNEuBO" though.

    • Blind4Basics Avatar

      right, I didn't really read the instructions, actually, but the expected solution isn't compliant with the requirements, yes.

      (edit: just realized the kind of CHEM_SYMBOLS is already given, actually. Or maybe it has been updated, dunno... x) )

    • Admiraal Avatar

      I have updated the description and checker; it now only checks if you use all letters and if your result contains valid symbols (if there is a result possible).

    • Blind4Basics Avatar

      This comment has been hidden.

    • Blind4Basics Avatar

      see above (manual notification)

    • Admiraal Avatar

      Thanks. It actually turned out my own solution was wrong xd

      Tests now also have been updated.

      Issue marked resolved by Admiraal 5 years ago
  • Unnamed Avatar

    Some tests pass lists as name.