Ad
  • Custom User Avatar

    And, the lift can be equipped with sensors to detect the number of people.

    Sure, it "can be". But in the real world have you ever seen such a thing? I think my current rule is closer to reality. The lift stops because someone called it... doors open... but sorry no more room... doors close.. lift continues.

  • Custom User Avatar

    I don't think this is a reasonable rule. It makes tests cases wired. And, the lift can be equipped with sensors to detect the number of people.

  • Custom User Avatar

    "When called, the Lift will stop at a floor even if it is full, although unless somebody gets off nobody else can get on!"

    Ah, right, makes sense now. Without that it would be way more efficient... but usually an elevator does not really know if there is still capacity.

  • Custom User Avatar
  • Default User Avatar

    Sorry but the kyu is not given by the author.

  • Default User Avatar

    "The Lift never changes direction until there are no more people wanting to get on/off in the direction it is already travelling"
    "When called, the Lift will stop at a floor even if it is full, although unless somebody gets off nobody else can get on!"
    I think these two rules explain why this will happen

  • Custom User Avatar

    i think it's wrong

    Well, it isn't.

    Is this was a random test then it might warrant time to figure what is going on... But this is expected results for the fixed test case "Fire Drill" AFAIK. Please note that 165 people already passed this Kata for C++ - seriously what are the chances that you are right but those 165 people are not?

  • Default User Avatar

    That definitely sounds like a dynamic memory allocation problem, check to make sure you stay inside the bounds of any heap memory you allocate

    (sorry i know this is an old post)

  • Custom User Avatar