Ad
  • Custom User Avatar

    Rejected:

    Original Swift translation was approved but deleted by someone, so no point in keeping this one. Also,

    • no random tests

    • outdated version

    • Missing useful assertion messages

    Please refer here on how to make corresponding changes and publish a new fork

  • Custom User Avatar

    Approved it and then realized that you should rename the function in initial code too. I'll rise an issue.

  • Custom User Avatar

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

  • Custom User Avatar

    In test cases you can find this method. Its not in public ones.

    func testRandom25000() {
            var attempts = 0
            while attempts < 25000 {
                let dart = (x: rand(min: -175, max: 175), y: rand(min: -175, max: 175))
    
                if !testDartboard.isBounce(dart: dart) {
                    XCTAssertEqual(dartboard.getScore(dart: dart), testDartboard.getScore(dart: dart))
                    attempts += 1
                }
            }
        }
    
  • Custom User Avatar

    I do not see the random test cases...

  • Custom User Avatar

    Test no longer pass when Stringy is not even working properly.
    Added random tests to prevent warriors to read them.
    Renamed Stringy to stringy to match swift codestyles.

  • Custom User Avatar

    I've modified swift tests to match java tests. Random tests are also included.
    If you find something unclear, leave me a message.

  • Custom User Avatar

    It was not approved, atleast I see still old descriptions on production kata. I'm just trying to fix something already broken. Now you can pass with valid solution, previously not possible.
    I'll add random test based on your solution.

  • Custom User Avatar

    Damn, I pushed the wrong button and there... this was approved. Your luck! Not my intention.

    Jee... This solution has crappy tests... The original tests are random, yours are a bunch of pairs!

    I am very unhappy with translations anyway. Many of them have errors I cannot do anything about.

    You are lucky: not good quality work, yes translation.

  • Custom User Avatar

    Previous solution was not working properly. Mainly because angle offset was set to 6 instead of 9 (360 / 20 / 2). I've inserted my solution, which I've 1:1 translated to java and passed test with. Fixed wrong tests - based on wrong solution.
    Added swift codestyle (class names, function/method names).

  • Custom User Avatar

    Same problem here