6 kyu

Tricky Kotlin #1: invoke a string

355 of 356ice1000
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • dkrancpiler Avatar

    Hello, I don't know where else to ask and since this is specifically for Kotlin I'm gonna try here. Can somebody help me out with checking where I made a mistake in any Kata using Kotlin? I don't know how to check the output log after I run the tests so I can hardly indentify errors (beginner in programming here, not just Kotlin). And I really don't understand what I am supposed to do in this Kata. I guess I should somewhere read about invoking? Thanks for your help!

    • ice1000 Avatar

      println("your log here")

      Btw this question should be asked on StackOverflow

    • dkrancpiler Avatar

      I'm sry, but I still don't get it... Only thing I see after running the test (in some other kata) is expected:<[[]]> but was:<[[0, 0]]>, and below that is Stack Trace. So I really don't understand what should I put into the print line (I know what is the problem which I need to fix in this example, so I don't need to see the whole process, just want to learn for future use)

      And did you mean this whole question or just the part about invoking? Thanks anyhow :)

  • MFazio23 Avatar

    This is a great Kata, but don't put "This is very easy!" in the beginning. It doesn't help anyone.

  • ianbrandt Avatar

    I ran into frequent timeouts trying to run the test cases for this one. Something to do with random number generation in the build environment, perhaps?

    • ice1000 Avatar

      Random number generating code:

      val r = Random(System.currentTimeMillis())
      

      Testing code:

      (0..100).forEach { r.nextLong().let { one assertion here } }
      
    • taylorjeffrey Avatar

      I've gone through 3 or 4 different Kotlin katas this morning and all of them timed-out. I don't think it's this kata specifically. The Kotlin implementation for Codewars seems to need some work.

    • ice1000 Avatar

      Oh! It's very common on CW. You'll get used to it soon :D CW's servers are not very stable.