Tuesday, January 27, 2015

Problem analysis

Response to
http://discourse.codenewbie.org/t/coding-exercise-problem-breakdown/618


  1. Check front door lock.
    1. If locked, unlock.
  2. Open front door.
  3. Until distance to car door = 0, walk toward car door (I'm deliberately ignoring pathing concerns, my car door is basically straight outside my front door)
  4. Check car door.
    1. If locked, unlock
  5. Open car door.
  6. Sit down in driver seat sideways.
  7. Juggle lunch, backpack, etc into passenger seat (this sort of crap is why robots tend to look so clumsy, just try and create an algorithm for how your arms move doing that, never mind controlling your balance through it all, your brain really is amazing)
  8. Pull feet into car.
  9. Close car door.
  10. Insert key into ignition.
  11. Turn key.

There are a few minor steps left out and there's some assumed knowledge like the car not having keyless ignition (mine does so this algorithm couldn't be applied naively to my case). It also assumes that you're able to carry whatever you're carrying without juggling anything around, and you don't have to find the right key on your key ring or look for your car in an apartment parking lot. And it still took 11 procedural steps.

Oh. And we never closed and re-locked the front door. That wasn't in the requirements. Of course in my case my wife does that in the morning so I suppose you could call me a good example of why you should follow the requirements doc once it's been reviewed and accepted by all parties.

No comments: