Ad
  • Custom User Avatar
    • No random tests

    • No tests to invalidate solutions which do not check for the validity of 1st and last bars of anacrusis

    • Python new test framework should be used

  • Default User Avatar

    C translation (author gone)

  • Custom User Avatar

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

  • Custom User Avatar
  • Default User Avatar

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

  • Custom User Avatar

    Ruby 3.0 should be enabled.

  • Default User Avatar
    Test.describe('Invalid rhythm - invalid meter')
    Test.assert_equals(validate_rhythm([7, 3], '222|111|2222222|1112|2222'), 'Invalid rhythm')
    Test.assert_equals(validate_rhythm([1, 3], '2|44|22'), 'Invalid rhythm')
    Test.assert_equals(validate_rhythm([9, 9], '444448|2288'), 'Invalid rhythm')
    
    Test.describe('Invalid rhythm - invalid score')
    Test.assert_equals(validate_rhythm([3, 3], '333|333|333'), 'Invalid rhythm')
    Test.assert_equals(validate_rhythm([5, 7], '777|77777|77'), 'Invalid rhythm')
    Test.assert_equals(validate_rhythm([2, 6], '66|66|66|66|66'), 'Invalid rhythm')
    

    The second of the above testing portions would otherwise all be valid, with the [5, 7] one having anacrusis, if not for the fact that both of these portions automatically & fully disqualify on the same principle: that there is no valid meter with 2nd element other than 1, 2, 4, or 8, (or potentially 16, and then validly but only esoterically 32 or 64). But nowhere in the description does it explicitly say what a valid 2nd meter value must be.

  • Default User Avatar

    Hi,

    Could you please explain the reason why those inputs are not valid ?

    Test.assert_equals(validate_rhythm([3, 3], '333|333|333'), 'Invalid rhythm')
    Test.assert_equals(validate_rhythm([5, 7], '777|77777|77'), 'Invalid rhythm')
    Test.assert_equals(validate_rhythm([2, 6], '66|66|66|66|66'), 'Invalid rhythm')
    

    I'm not musician, but if I remember well, thirds, seventh, sixth exist well, don't they ? :-o I'm a bit lost, there... ;)

    Thx!

  • Custom User Avatar

    Test cases should cover "Cb", "B#", "E#" and "Fb", I think.