Retired

Thirsty Robot v2 (retired)

Description
Loading description...
Fundamentals
Arrays
Data Types
  • Please sign in or sign up to leave a comment.
  • docgunthrop Avatar

    The test case [ 62.41, 8, 8.3456, 4, 13, 2 ] gives the following message:

    Expected: 'Oh dear', instead got: 'Poor robot'

    This is an "Oh dear" array that has liquor as its first element.

    The Description states:

    An "oh dear" array that contains any instance of liquor should return "Poor robot".

  • docgunthrop Avatar

    Description has some logical inconsistency.

    An array of just beer should return "Fine".

    An array of just wine should return "Fine".

    An array where any instance of wine precedes beer should return "Oh dear".

    A "fine" array that contains any instance of liquor should return "Wonky robot".

    This means that an array that contains only wine or only beer, but also includes liquor (makes no sense because it cannot be) is a "fine" array.

    It makes more sense to change it to:

    An array where any instance of wine precedes beer is NOT a "fine" array. Otherwise, the array is a "fine" array.
    A "fine" array that contains any instance of liquor should return "Wonky robot", otherwise it should return "fine".
    An array that is not "fine" should return "Poor robot" if it contains any instance of liquor, otherwise it should return "oh dear".
    
  • JohanWiltink Avatar

    That is not how you use Test.expect.

    ( The correct way involves not using Test.expect at all. )