Ad
  • Custom User Avatar

    That´s exactly my case here... I just cannot give up yet, but I keep on staring at the code and wondering if it´s the serve´s fault

  • Custom User Avatar

    You can't rearrange the words and they have to be consecutive in the array.

  • Custom User Avatar

    Sorry, but I had the same question, and I do not see why your question is wrong. '3452' is shorter than 'wkppv'. Why is the former included and not the latter?

  • Custom User Avatar

    You're wrong, print the input to see it, you shouldn't change the order of the strings.

    Array
    (
        [0] => wlwsasphmxx
        [1] => owiaxujylentrklctozmymu
        [2] => wpgozvxxiu
    )
    

    'wlwsasphmxx' + 'owiaxujylentrklctozmymu' = 'wlwsasphmxxowiaxujylentrklctozmymu'

  • Custom User Avatar

    OK, thanks.
    You are not failing this test:
    $this->revTest(bouncingBall(30.0, 0.66, 1.5), 15); but this one (not in "RUN SAMPLE TESTS" but in fixed tests of "SUBMIT":
    $this->revTest(bouncingBall(30, 0.75, 1.5), 21);.
    If you had printed the input and your output you could easily have seen that...
    In the description you have read:

    The ball bounces (for example), to two-thirds of its height (a bounce of 0.66).

    But it is only un example (it is written for example).

    Below you should have read:

    Float parameter "bounce" must be greater than 0 and less than 1

    From that you see that bounce is a parameter, not a constant.

    Is that clearer now?

  • Custom User Avatar

    There is something I don't understand. PHPUnit test definition is: assertEquals(mixed $expected, mixed $actual[, string $message = '']) and when you "RUN SAMPLE TESTS" the function "$this->revTest(bouncingBall(30.0, 0.66, 1.5), 15);" gives (look the definition of revTest) $this->assertEquals(15, bouncingBall(30.0, 0.66, 1.5));. Hence "expected" is 15.
    I would have understood you got "Failed asserting that 21 matches expected 15." No offense but did you exactly copy what PHP Unit returns?
    Could you post your code with three backticks at the beginning and three others at the end so that your code is correctly indented? Moreover mark your code as spoiler. Thanks.