Ad
  • 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
                }
            }
        }
    
  • Default User Avatar

    I do not see the random test cases...

  • 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.

  • Default 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).

  • Default User Avatar

    Thanks for your translation...