Ad
  • Custom User Avatar

    I cannot see various codes, because except complaining, you did not bother to share the actual code which does not work for you. All I could do is to check your most recent code (which I can sometimes do), and I saw that it does not conform to input specification of the task.

    I can also see that you completed the kata, what I presume means that you found your mistake. However I still do not understand where the "works perfectly in GHCi" came from, as it did not handle valid inputs at all.

  • Custom User Avatar

    I have no idea how you can see the various codes that I entered

    We can just do that, after we ourselves had solved it. Mods can see it in even more detail.

    why you doubt me?!

    Why the heck do you doubt the tests?! How could it be approved and sit for years if the tests were wrong? This isn't even factoring that there seems to be a real issue of no random tests available (but that's beside the point).

    this code running in GHCi, all correctly

    We hear this every day, and at least 9/10 times it isn't "all correctly", or it doesn't conform to CW's interface. Your local environment is not the same as codewars environment.

    one version with error handling

    Were you asked to do error handling for this kata? No, it's only valid inputs. So, don't worry about handling it. For this kata, monads shouldn't even come into the picture.

    It seems that you're overcomplicating the task and trying to involve I/O ? Just focus on function signature at hand and keep things pure.

  • Default User Avatar

    I have no idea how you can see the various codes that I entered and why you doubt me?! I have three versions of this code running in GHCi, all correctly. Including one version with error handling if input text isn't one of the three std input strings. I was talking on Discord FP server in the #haskell-beginners channel and getting some help.

    There seems to be an issue with the read command (and readMaybe) working in GHC and not in Codewars. I removed all the use of datatypes and just used strings instead so i didn't need the read or readMaybe functions and it works in CodeWars too. Seems Codewars does not like read.

  • Custom User Avatar

    Your code is not correct, and I honestly doubt it works in your GHCi correctly.

  • Default User Avatar

    My Haskell code works perfectly in GHCi. Fails on each test when I hit "Attempt" button. Seems like many others have same issue in other languages.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    this is smart... amazing

  • Default User Avatar
  • Custom User Avatar

    bcs you spelled player wrong
    instead u said playar

  • Default User Avatar

    you're joking men

  • Custom User Avatar

    Tests have been updated since, so the error is not reproducible now, closing.

  • Default User Avatar

    I see that some solutions are using "unit" to mean the object, others are using "unit" to mean the amount it moves. And that fits with my initial confusion that it could go either way.

  • Default User Avatar

    thanks
    this actually helped
    i had no idea as to why it wasnt passing till i read this

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Yesss, I made the exchange and it resolved

  • Loading more items...